@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

:root {
  --bg: #f5f4f0;
  --surface: #ffffff;
  --surface2: #fafaf8;
  --border: #e8e6e1;
  --border2: #d5d2cb;
  --text: #1c1917;
  --text2: #78716c;
  --text3: #a8a29e;
  --green: #16a34a; --green-bg: #f0fdf4; --green-border: #bbf7d0;
  --blue: #2563eb;  --blue-bg:  #eff6ff; --blue-border:  #bfdbfe;
  --amber: #d97706; --amber-bg: #fffbeb; --amber-border: #fde68a;
  --red: #dc2626;   --red-bg:   #fef2f2; --red-border:   #fecaca;
  --radius: 12px; --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
}

#eisenhower-app * { box-sizing: border-box; margin: 0; padding: 0; }
#eisenhower-app { font-family: 'Inter', -apple-system, sans-serif; font-size: 14px; color: var(--text); background: var(--bg); min-height: 100vh; padding: 0; }

/* ── Layout shell ── */
.em-shell { max-width: 1080px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }

/* ── Header ── */
.em-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; }
.em-header-left { }
.em-breadcrumb { font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text3); margin-bottom: 6px; }
.em-title { font-size: 24px; font-weight: 600; color: var(--text); letter-spacing: -0.02em; line-height: 1.2; }
.em-header-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.em-user-pill { display: flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 5px 12px 5px 8px; font-size: 12px; color: var(--text2); }
.em-user-avatar { width: 20px; height: 20px; border-radius: 50%; background: var(--green); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 600; color: white; flex-shrink: 0; }
.em-btn { font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 500; padding: 7px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text2); cursor: pointer; transition: all 0.15s; white-space: nowrap; }
.em-btn:hover { border-color: var(--border2); color: var(--text); background: var(--surface2); }
.em-btn.primary { background: var(--text); color: #fff; border-color: var(--text); }
.em-btn.primary:hover { background: #2c2924; }
.em-btn.danger:hover { color: var(--red); border-color: var(--red-border); background: var(--red-bg); }

/* ── Stats bar ── */
.em-stats { display: flex; gap: 8px; margin-bottom: 1.5rem; flex-wrap: wrap; }
.em-stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 16px; display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 100px; }
.em-stat-num { font-size: 22px; font-weight: 600; letter-spacing: -0.03em; color: var(--text); line-height: 1; }
.em-stat-label { font-size: 11px; color: var(--text3); font-weight: 500; }

/* ── Legend strip ── */
.em-legend { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-bottom: 2rem; }
.em-lcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; cursor: default; }
.em-lcard-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.em-lcard-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.em-lcard-name { font-size: 13px; font-weight: 600; color: var(--text); }
.em-lcard-desc { font-size: 11px; color: var(--text3); line-height: 1.4; }
.em-lcard-tag { display: inline-block; font-size: 10px; font-weight: 600; border-radius: 4px; padding: 2px 6px; margin-top: 8px; }
.lc-do .em-lcard-dot   { background: var(--green); }
.lc-sch .em-lcard-dot  { background: var(--blue); }
.lc-del .em-lcard-dot  { background: var(--amber); }
.lc-eli .em-lcard-dot  { background: var(--red); }
.lc-do .em-lcard-tag   { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); }
.lc-sch .em-lcard-tag  { background: var(--blue-bg);  color: var(--blue);  border: 1px solid var(--blue-border); }
.lc-del .em-lcard-tag  { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-border); }
.lc-eli .em-lcard-tag  { background: var(--red-bg);   color: var(--red);   border: 1px solid var(--red-border); }

/* ── Inbox ── */
.em-inbox-section { margin-bottom: 2rem; }
.em-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.em-section-title { font-size: 12px; font-weight: 600; color: var(--text2); letter-spacing: 0.04em; text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
.em-badge { background: var(--text); color: #fff; font-size: 10px; font-weight: 700; border-radius: 10px; padding: 1px 6px; }
.em-section-hint { font-size: 12px; color: var(--text3); }
.em-inbox-board { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; min-height: 72px; display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; transition: border-color 0.2s, background 0.2s; }
.em-inbox-board.drag-over { border-color: var(--border2); background: var(--surface2); }
.em-inbox-empty { font-size: 13px; color: var(--text3); width: 100%; text-align: center; padding: 8px 0; }
.em-add-row { display: flex; gap: 8px; margin-top: 8px; }
.em-add-row input { flex: 1; font-family: 'Inter', sans-serif; font-size: 13px; padding: 9px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text); outline: none; transition: border-color 0.2s; }
.em-add-row input::placeholder { color: var(--text3); }
.em-add-row input:focus { border-color: var(--border2); box-shadow: 0 0 0 3px rgba(0,0,0,0.04); }

/* ── Tasks ── */
.task { display: inline-flex; align-items: center; gap: 7px; border-radius: var(--radius-sm); font-size: 13px; font-family: 'Inter', sans-serif; cursor: grab; user-select: none; transition: opacity 0.15s, box-shadow 0.15s, transform 0.1s; line-height: 1.35; position: relative; }
.task:active { cursor: grabbing; }
.task.dragging { opacity: 0.2; }
.task.done .task-text { text-decoration: line-through; opacity: 0.45; }

/* Inbox chip */
.task-chip { padding: 6px 10px 6px 10px; background: var(--surface); border: 1px solid var(--border); color: var(--text); box-shadow: var(--shadow); }
.task-chip:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

/* Quadrant row */
.task-row { padding: 8px 10px; background: var(--surface2); border: 1px solid var(--border); color: var(--text); width: 100%; border-radius: var(--radius-sm); }
.task-row:hover { background: var(--surface); border-color: var(--border2); }

.task-drag-handle { color: var(--text3); font-size: 11px; cursor: grab; opacity: 0.4; flex-shrink: 0; }
.task-text { flex: 1; }
.task-actions { display: flex; align-items: center; gap: 3px; opacity: 0; transition: opacity 0.1s; flex-shrink: 0; }
.task:hover .task-actions { opacity: 1; }
.task-action-btn { font-size: 12px; color: var(--text3); cursor: pointer; padding: 2px 3px; border-radius: 4px; line-height: 1; transition: color 0.1s, background 0.1s; }
.task-action-btn:hover { background: var(--border); color: var(--text); }
.task-action-btn.check:hover { color: var(--green); }
.task-action-btn.del:hover { color: var(--red); }
.task-action-btn.done-active { color: var(--green); opacity: 1 !important; }

/* ── Matrix ── */
.em-matrix-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.em-axis-wrap { display: grid; grid-template-columns: 24px 1fr; grid-template-rows: 24px 1fr; gap: 0; }
.em-axis-top { grid-column: 2; display: flex; justify-content: space-between; padding: 0 16px 8px; }
.em-axis-top span { font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text3); }
.em-axis-left { grid-row: 2; display: flex; flex-direction: column; justify-content: space-between; align-items: center; padding: 16px 0; }
.em-axis-left span { font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text3); writing-mode: vertical-rl; transform: rotate(180deg); }
.em-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.quadrant { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; min-height: 220px; display: flex; flex-direction: column; transition: border-color 0.2s, background 0.2s; box-shadow: var(--shadow); }
.quadrant.drag-over { border-color: var(--border2); background: var(--surface2); }
.q-do       { border-top: 2px solid var(--green); }
.q-schedule { border-top: 2px solid var(--blue); }
.q-delegate { border-top: 2px solid var(--amber); }
.q-eliminate{ border-top: 2px solid var(--red); }

.q-header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.q-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.q-do .q-dot       { background: var(--green); }
.q-schedule .q-dot  { background: var(--blue); }
.q-delegate .q-dot  { background: var(--amber); }
.q-eliminate .q-dot { background: var(--red); }
.q-label { font-size: 13px; font-weight: 600; color: var(--text); flex: 1; }
.q-count { font-size: 11px; font-weight: 600; color: var(--text3); background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 1px 7px; }

.tasks { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.q-empty { font-size: 12px; color: var(--text3); text-align: center; padding: 1rem 0; flex: 1; display: flex; align-items: center; justify-content: center; border: 1.5px dashed var(--border); border-radius: var(--radius-sm); }
.add-area { margin-top: 10px; }
.add-btn { font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 500; color: var(--text3); background: none; border: none; cursor: pointer; padding: 4px 0; display: flex; align-items: center; gap: 5px; transition: color 0.15s; width: 100%; }
.add-btn:hover { color: var(--text2); }
.add-input { width: 100%; font-family: 'Inter', sans-serif; font-size: 13px; padding: 7px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border2); background: var(--surface); color: var(--text); outline: none; display: none; }
.add-input:focus { box-shadow: 0 0 0 3px rgba(0,0,0,0.04); }

/* ── Edit overlay ── */
.task-edit-input { font-family: 'Inter', sans-serif; font-size: 13px; padding: 6px 10px; border-radius: var(--radius-sm); border: 1.5px solid var(--border2); background: var(--surface); color: var(--text); outline: none; width: 100%; }

/* ── Modal ── */
#em-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; z-index: 9999; padding: 1rem; backdrop-filter: blur(6px); }
.em-modal { background: var(--surface); border-radius: 16px; padding: 2rem; width: 100%; max-width: 380px; box-shadow: var(--shadow-md); border: 1px solid var(--border); }
.em-modal-eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text3); margin-bottom: 8px; }
.em-modal-title { font-size: 20px; font-weight: 600; color: var(--text); letter-spacing: -0.02em; margin-bottom: 6px; }
.em-modal-sub { font-size: 13px; color: var(--text2); margin-bottom: 1.5rem; line-height: 1.55; }
.em-modal input[type="email"] { width: 100%; font-family: 'Inter', sans-serif; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; color: var(--text); outline: none; margin-bottom: 6px; background: var(--bg); transition: border-color 0.2s; }
.em-modal input[type="email"]:focus { border-color: var(--border2); box-shadow: 0 0 0 3px rgba(0,0,0,0.04); }
.em-error { font-size: 12px; color: var(--red); min-height: 18px; margin-bottom: 10px; }
.em-modal-btn { width: 100%; font-family: 'Inter', sans-serif; padding: 11px; background: var(--text); color: #fff; border: none; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; cursor: pointer; transition: background 0.15s; }
.em-modal-btn:hover { background: #2c2924; }
.em-modal-btn:disabled { opacity: 0.5; cursor: default; }
.em-modal-note { font-size: 11px; color: var(--text3); text-align: center; margin-top: 10px; }

/* ── Responsive ── */
@media (max-width: 720px) {
  .em-shell { padding: 1rem 1rem 3rem; }
  .em-legend { grid-template-columns: 1fr 1fr; }
  .em-stats { gap: 6px; }
  .em-stat { padding: 8px 12px; }
  .em-axis-wrap { grid-template-columns: 1fr; grid-template-rows: auto; }
  .em-axis-top, .em-axis-left { display: none; }
  .em-grid { grid-template-columns: 1fr; }
  .quadrant { min-height: 140px; }
  .em-header { gap: 12px; }
  .em-header-right { width: 100%; justify-content: flex-end; }
  .em-lcard-tag { display: none; }
}
@media (max-width: 480px) {
  .em-legend { grid-template-columns: 1fr 1fr; gap: 6px; }
  .em-lcard { padding: 10px 12px; }
  .em-title { font-size: 20px; }
  .em-add-row { flex-direction: column; }
  .em-add-row .em-btn { width: 100%; text-align: center; justify-content: center; }
}
