/**
 * money-calendar/styles.css — layout styles for MoneyCalendar lib.
 *
 * Namespace: `.mc-*` prefix (money-calendar). Avoids collision with
 * payments `.p-cal-*` classes.
 *
 * Colors: layout via Team Portal CSS vars (--fg, --line-2, --muted, --bg).
 * Status colors (paid green / late purple / etc.) are applied inline from
 * STATUS_COLORS map in index.js — data-driven, extensible via config.
 */

.mc-root {
  color: var(--fg);
}

.mc-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px 0;
}

/* ── Undated section ─────────────────────────────────────── */

.mc-undated {
  border-radius: 12px;
  background: var(--panel, rgba(255,255,255,0.02));
  border: 1px solid var(--line-2, rgba(148,163,184,0.15));
  padding: 14px;
}

.mc-undated-toggle {
  background: transparent;
  border: 0;
  color: var(--fg);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

.mc-undated-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
}

.mc-undated-arrow {
  font-size: 11px;
  color: var(--muted);
}

.mc-undated-title {
  color: var(--fg);
}

.mc-undated-total {
  font-size: 13px;
  color: var(--muted);
}

.mc-undated-content {
  margin-top: 12px;
  flex-direction: column;
  gap: 6px;
}

.mc-undated-card {
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

/* ── Main panel ─────────────────────────────────────────── */

.mc-panel {
  border-radius: 12px;
  background: var(--panel, rgba(255,255,255,0.02));
  border: 1px solid var(--line-2, rgba(148,163,184,0.15));
  padding: 16px;
}

.mc-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.mc-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mc-nav-btn {
  padding: 6px 14px;
  font-size: 16px;
  line-height: 1;
  background: transparent;
  border: 1px solid var(--line-2, rgba(148,163,184,0.3));
  color: var(--fg);
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
}

.mc-nav-btn:hover {
  background: rgba(255,255,255,0.05);
}

.mc-week-range {
  font-size: 18px;
  margin: 0;
  min-width: 240px;
  text-align: center;
  color: var(--fg);
  font-weight: 500;
}

/* Round 2 (block 7.2): 2-line week total — plan/fact stacked with color labels. */
.mc-week-total {
  font-size: 13px;
  color: var(--muted);
  text-align: right;
  line-height: 1.35;
}

.mc-week-total-line {
  font-size: 13px;
}

.mc-week-total-line.mc-week-plan {
  color: rgba(252, 165, 165, 0.9);
}

.mc-week-total-line.mc-week-fact {
  color: rgba(134, 239, 172, 0.9);
}

/* ── Grid ──────────────────────────────────────────────── */

.mc-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.mc-day-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.mc-day-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 6px;
  border-bottom: 1px solid var(--line-2, rgba(148,163,184,0.15));
  min-width: 0;
}

.mc-day-name {
  font-size: 12px;
  color: var(--fg);
  font-weight: 500;
}

/* Round 2 (block 7.2): 2-line day sub — plan on top, fact below.
   Vertically stacked with distinct colors for at-a-glance recognition. */
.mc-day-sub {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  color: var(--muted);
  min-width: 0;
}

.mc-day-sub-plan,
.mc-day-sub-fact {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mc-day-sub-plan {
  color: rgba(252, 165, 165, 0.9);
}

.mc-day-sub-fact {
  color: rgba(134, 239, 172, 0.9);
}

.mc-day-cards {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

/* ── Cards ─────────────────────────────────────────────── */

.mc-card {
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  transition: filter 0.15s ease;
}

.mc-card:hover {
  filter: brightness(1.1);
}

.mc-card-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mc-card-amount {
  font-weight: 600;
}

/* Fact cards may want subtle visual distinction (dashed border for
   "fact only" state) — apply if design wants later.
.mc-card-fact {
  border-style: dashed;
}
*/

/* ── Empty state ─────────────────────────────────────── */

.mc-empty {
  padding: 32px 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
