/* =====================================================
   DASHBOARD — page-specific styles
   shared/index.css
   Loaded by dashboard.html alongside shared/styles.css
===================================================== */

/* ── Layout ───────────────────────────────────────── */
.idx-main {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background-color: var(--surface);
  border-radius: 0.625rem;
box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25);
}

/* ── Header ───────────────────────────────────────── */
.idx-header {
  position: relative;
  padding: 2.25rem 2.5rem 1.75rem;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  flex-shrink: 0;
}

.idx-greeting-block {
  position: relative;
  z-index: 1;
}

.idx-greeting {
  font-family: "Montagu Slab", serif;
  font-size: 2.25rem;
  font-weight: 400;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 1rem;
  letter-spacing: -0.13125rem;
}

/* ── Stat tags ────────────────────────────────────── */
.idx-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.idx-stat-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 6px;
  border-radius: 0.3125rem;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  font-family: "Syne", sans-serif;
}

.idx-stat-count {
  font-weight: 700;
  font-family: "Instrument Sans", sans-serif;
}

/* Today — blue */
.idx-stat-tag--today {
  background: var(--today-badge-bkg);
  color: var(--today-badge-text);
}

/* Active projects — olive green */
.idx-stat-tag--active {
  background: var(--active-badge-bkg);
  color: var(--active-badge-text);
}

/* Overdue — red */
.idx-stat-tag--overdue {
  background: var(--priority-high-bg);
  color: var(--priority-high);
}

/* Losing momentum — amber */
.idx-stat-tag--momentum {
  background: var(--priority-med-bg);
  color: var(--priority-med);
}

/* ── Body content area ────────────────────────────── */
.idx-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 35%;
  gap: 0;
  align-items: start;
}

.idx-col-left {
  padding: 2rem 2rem 2rem 2.5rem;
}

.idx-col-right {
  padding: 2rem 2.5rem 2rem 1.5rem;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 600px) {
  .idx-header { padding: 1em; }
  .idx-greeting { font-size: 1.625rem; }
  .idx-body { padding: 1em; gap: 1em; }
}

/* =====================================================
   YOUR DAY — task list section
   yd- prefix
===================================================== */

/* ── Section wrapper ──────────────────────────────── */
.yd-section {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Section header row ───────────────────────────── */
.yd-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.yd-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: "Montagu Slab", serif;
}

/* Sort dropdown */
.yd-sort-wrap {
  position: relative;
}

.yd-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.625rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.yd-sort-btn svg {
  opacity: 0.5;
}

/* Filter tabs */
.yd-tabs {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
}

.yd-tab {
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  border: none;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}

.yd-tab:hover {
  background: var(--surface);
  color: var(--text);
}

.yd-tab.active {
  background: var(--text);
  color: var(--bg);
}

.yd-tab.disabled {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}

/* ── Task list ────────────────────────────────────── */
.yd-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Task row ─────────────────────────────────────── */
.yd-task {
  display: grid;
  grid-template-columns: 1.25rem 1fr;
  gap: 0 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}

.yd-task:first-child {
  border-top: 1px solid var(--border);
}

/* Checkbox */
.yd-check {
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 0.125rem;
  transition: background 0.15s, border-color 0.15s;
  appearance: none;
  -webkit-appearance: none;
}

.yd-check:hover {
  border-color: var(--brand);
}

/* Task content */
.yd-task-content {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.yd-task-title {
  font-size: 0.8375rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.yd-task-desc {
  font-size: 0.8125rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Meta row */
.yd-task-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.375rem;
  flex-wrap: wrap;
}

.yd-proj-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.yd-proj-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--brand);
  flex-shrink: 0;
}

.yd-meta-sep {
  color: var(--border);
  font-size: 0.75rem;
}

.yd-priority {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
}

.yd-priority--high   { background: var(--priority-high-bg); color: var(--priority-high); }
.yd-priority--medium { background: var(--priority-med-bg);  color: var(--priority-med);  }
.yd-priority--low    { background: var(--priority-low-bg);  color: var(--priority-low);  }

.yd-reschedule {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.375rem 0.5625rem;
  text-decoration: none;
  border-radius: 0.3125rem;
border: 1px solid var(--Softer-Gray-2, #E4E4E4);
}

.yd-reschedule:hover {
  color: var(--text);
}

/* Empty state */
.yd-empty {
  padding: 2rem 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
}

/* ── Add task ─────────────────────────────────────── */
.yd-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.875rem;
  font-size: 0.875rem;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.yd-add-btn:hover {
  color: var(--text);
}

/* Quick-add inline form */
.yd-quick-add {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.yd-quick-add-row {
  display: flex;
  gap: 0.625rem;
  flex-wrap: wrap;
}

.yd-quick-input {
  flex: 1;
  min-width: 0;
  padding: 0.4375rem 0.625rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.875rem;
  font-family: inherit;
}

.yd-quick-input:focus {
  outline: none;
  border-color: var(--brand);
}

.yd-quick-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.yd-quick-save {
  padding: 0.4375rem 1rem;
  background: var(--text);
  color: var(--bg);
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.yd-quick-save:hover {
  opacity: 0.85;
}

.yd-quick-cancel {
  padding: 0.4375rem 0.75rem;
  background: none;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.875rem;
  cursor: pointer;
  font-family: inherit;
}

.yd-quick-cancel:hover {
  color: var(--text);
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 600px) {
  .yd-tabs { gap: 0.125rem; margin-left: unset; }
  .yd-tab  { padding: 0.25rem 0.5rem; font-size: 0.75rem; }
}

/* =====================================================
   PROJECT CARDS — right column
   idx-proj- prefix
===================================================== */

.idx-proj-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
}

.idx-proj-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.875rem;
  border-radius: 0.5rem;
border: 1px solid rgba(142, 142, 142, 0.36);
background: #FBF9F5;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.idx-proj-card:hover {
  border-color: var(--brand);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.idx-proj-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.idx-proj-card-name {
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: -1px;
  color: var(--text);
  line-height: 1.3;
  font-family: "Montagu Slab", serif;
}

.idx-proj-card-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  white-space: nowrap;
  background: var(--active-badge-bkg);
  color: var(--active-badge-text);
  flex-shrink: 0;
}

.idx-proj-card-desc {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

.idx-proj-health {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  align-self: flex-start;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background-color: transparent !important;
}

.idx-proj-health-dot {
  width: 0.4375rem;
  height: 0.4375rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.idx-proj-empty {
  font-size: 0.875rem;
  color: var(--muted);
  text-align: center;
  padding: 1.5rem 0;
}

/* =====================================================
   MILESTONES — right column
   idx-ms- prefix
===================================================== */

.idx-ms-section {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-radius: 0.5rem;
border: 1px solid rgba(142, 142, 142, 0.36);
background: #F2F7FF;
padding: 1.25rem;
}

.idx-ms-header {
  margin-bottom: 0.75rem;
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 860px) {
  .idx-body {
    grid-template-columns: 1fr;
  }
  .idx-col-left,
  .idx-col-right {
    height: auto;
    overflow-y: visible;
    border-left: none;
  }
  .idx-col-right {
    border-top: 1px solid var(--border);
    padding: 1.5rem 1rem;
  }
}

@media (max-width: 600px) {
  .idx-col-left { padding: 0px; }
  .idx-proj-grid { grid-template-columns: 1fr; }
}

/* ── Completed tab ────────────────────────────────── */
.yd-done-day { margin-bottom: 0.25rem; }

.yd-done-day-hdr {
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.07em;
  color: var(--text);
  text-transform: uppercase;
  padding: 0.6rem 0 0.45rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.35rem;
  font-family: "Montagu Slab", serif;
}

.yd-done-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.yd-done-name {
  font-size: 0.8125rem;
  color: var(--text-2, var(--text));
  border: 1px solid var(--border);
  border-radius: 0.3125rem;
  padding: 0.2rem 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 55%;
  text-decoration: line-through;
}

.yd-done-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.yd-done-proj {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: var(--text-2, var(--text));
  background: var(--surface2);
  border-radius: 2rem;
  padding: 0.15rem 0.5rem;
  white-space: nowrap;
}

.yd-done-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.yd-done-ts {
  font-size: 0.6875rem;
  color: var(--text-muted, var(--text-2, #888));
  white-space: nowrap;
}

/* ── Dashboard Calendar Section ───────────────────── */
.idx-calendar-section {
  border-top: 1px solid var(--border);
  padding: 2rem 2.5rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 2em;
}

.idx-cal-hdr {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.idx-cal-title {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--text);
  min-width: 10rem;
  text-align: center;
  font-family: "Montagu Slab", serif;
}

.idx-cal-nav {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 0.375rem;
  padding: 0.25rem 0.6rem;
  font-size: 0.875rem;
  cursor: pointer;
  line-height: 1;
}
.idx-cal-nav:hover { background: var(--surface2); }

.idx-cal-today-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 0.375rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  cursor: pointer;
  margin-left: auto;
}
.idx-cal-today-btn:hover { background: var(--surface2); }

/* Task bar inside calendar day cell */
.dct-bar {
  display: flex;
  align-items: flex-start;
  gap: 0.3rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 0.3125rem;
  padding: 0.2rem 0.4rem;
  font-size: 0.6875rem;
  color: var(--text);
  margin-bottom: 0.2rem;
  cursor: pointer;
  overflow: hidden;
  line-height: 1.3;
  transition: background 0.15s;
  flex-direction: column;
}
.dct-bar:hover { background: var(--accent-bg, rgba(99,102,241,.08)); }
.dct-bar.dragging { opacity: 0.35; cursor: grabbing; }

.dct-bar-name {
  flex: 1;
  white-space: normal;
  word-break: break-word;
  line-height: 1.35;
}

.dct-bar-proj {
  flex-shrink: 0;
  font-size: 0.625rem;
  background: var(--active-badge-bkg);
  color: var(--active-badge-text);
  border-radius: 0.25rem;
  padding: 0.1rem 0.35rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 5rem;
}

/* ── Clickable task content → opens sidebar ───────── */
.yd-task-content--clickable {
  cursor: pointer;
}
.yd-task-content--clickable:hover .yd-task-title {
  color: var(--brand, #6a994e);
}


/* ── Dashboard Calendar: mobile list view ──────────── */
@media (max-width: 48rem) {
  .idx-calendar-section {
    padding: 1.5rem 1rem 2rem;
  }
  .idx-cal-hdr {
    gap: 0.5rem;
    margin-bottom: 0;
    flex-wrap: wrap;
  }
  /* List wrapper — natural height, no flex-1 needed */
  .idx-mob-cal-list {
    background: var(--surface);
    border-top: 1px solid var(--border);
  }
  /* Override mob-cal-content behavior inside dashboard */
  .idx-calendar-section .mob-cal-content {
    background: var(--surface);
    overflow-y: visible;
    flex: none;
  }
}
