/* ============================================================
   Weekly Agenda — 7-day planner + open-tasks rail
   ============================================================ */

.modal.agenda-modal {
  width: min(1040px, 95vw);
  max-width: 1040px;
  height: min(780px, 92vh);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.ag-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
}
.ag-title {
  font-family: var(--font-display, "Space Grotesk", sans-serif);
  font-size: 17px;
  font-weight: 600;
  min-width: 220px;
  text-align: center;
  color: var(--text);
}

.ag-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.ag-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  padding: 12px 20px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.ag-col {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
  min-height: 0;
  transition: background 0.1s, border-color 0.1s;
}
.ag-col.ag-today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.ag-col.ag-drop { border-style: dashed; border-color: var(--accent); background: var(--bg-active); }

.ag-col-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 7px 9px 5px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.ag-col-head:hover { background: var(--bg-hover); }
.ag-dow {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.ag-daynum {
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.ag-today .ag-daynum { color: var(--accent); }

.ag-col-body {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scrollbar-width: thin;
}
.ag-ev {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  line-height: 1.35;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
  overflow: hidden;
}
.ag-ev-tx { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-ev-ic { font-size: 11px; flex: none; }
.ag-ev-note { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.ag-ev-note:hover { background: color-mix(in srgb, var(--accent) 24%, transparent); }
.ag-ev-db { background: color-mix(in srgb, #1a9d6e 13%, transparent); }
.ag-ev-db:hover { background: color-mix(in srgb, #1a9d6e 22%, transparent); }
.ag-ev-rem { background: var(--bg-hover); }
.ag-ev-rem:hover { background: var(--bg-active); }
.ag-ev-dot { color: #e0a13a; font-size: 8px; flex: none; }
.ag-ev-done { opacity: 0.55; }
.ag-ev-done .ag-ev-tx { text-decoration: line-through; }
.ag-ev-done .ag-ev-dot { color: #1a9d6e; }
.ag-dragging { opacity: 0.4; }

.ag-tasks {
  border-top: 1px solid var(--border);
  padding: 12px 20px 16px;
  max-height: 34%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.ag-tasks-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 8px;
}
.ag-tasks-head .ic { color: var(--accent); }
.ag-tasks-count { color: var(--text-faint); font-weight: 500; }
.ag-tasks-list {
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 4px;
  scrollbar-width: thin;
}
.ag-task {
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 7px;
  padding: 7px 10px;
  cursor: pointer;
  font: inherit;
  color: var(--text);
  transition: background 0.12s, border-color 0.12s;
}
.ag-task:hover { background: var(--bg-hover); border-color: var(--border); }
.ag-task-box {
  flex: none;
  width: 15px;
  height: 15px;
  border: 1.5px solid var(--border-strong);
  border-radius: 4px;
}
.ag-task-tx { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-task-pg { font-size: 11px; color: var(--text-faint); flex: none; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-tasks-empty { font-size: 13px; color: var(--text-faint); padding: 8px 2px; }

@media (max-width: 760px) {
  .ag-week { grid-template-columns: repeat(7, 1fr); padding: 8px; gap: 1px; }
  .ag-ev-tx { display: none; }
  .ag-title { min-width: 140px; font-size: 15px; }
  .ag-tasks-list { grid-template-columns: 1fr; }
}
