/* FEAT-672 — My Day Widget (myday-*)
   Dark-first; light theme at the bottom.
   Prefix: myday-
   390px breakpoint tested.
*/

/* ── Widget container ─────────────────────────────────────────────────────── */
.myday-widget {
  background: #1a1f2e;
  border-radius: 10px;
  padding: 20px 24px 16px;
  margin-bottom: 28px;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.myday-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}
.myday-title {
  color: #e8eaf0;
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 2px 0;
  letter-spacing: 0.04em;
}
.myday-header-sub {
  color: #9aa3b5;
  font-size: 13px;
}
.myday-depot-wrap {
  display: flex;
  align-items: center;
}

/* ── KPI Strip ───────────────────────────────────────────────────────────── */
.myday-kpi-strip {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.myday-kpi-tile {
  min-width: 130px;
  flex: 1 1 130px;
  background: #252b3b;
  border-radius: 8px;
  padding: 12px 14px;
  cursor: default;
}
.myday-kpi-label {
  color: #9aa3b5;
  font-size: 11px;
  margin-bottom: 4px;
  line-height: 1.3;
}
.myday-kpi-value {
  color: #e8eaf0;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}
.myday-trend {
  font-size: 11px;
  margin-bottom: 4px;
}
.myday-trend-good    { color: #5ec97e; }
.myday-trend-bad     { color: #dc3545; }
.myday-trend-neutral { color: #9aa3b5; }
.myday-kpi-error {
  color: #dc3545;
  font-size: 12px;
  padding: 8px 0;
}

/* ── Sparkline ───────────────────────────────────────────────────────────── */
.myday-sparkline {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 30px;
  margin-top: 4px;
}
.myday-spark-bar {
  display: inline-block;
  width: 8px;
  background: #4a90d9;
  border-radius: 2px 2px 0 0;
  opacity: 0.7;
}
.myday-sparkline-empty { height: 30px; display: block; }

/* ── Tabs ────────────────────────────────────────────────────────────────── */
.myday-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.myday-tab {
  background: transparent;
  border: 1px solid #3a3f52;
  color: #9aa3b5;
  border-radius: 6px;
  padding: 5px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.myday-tab:hover { background: #252b3b; color: #e8eaf0; }
.myday-tab-active {
  background: #252b3b;
  border-color: #4a90d9;
  color: #e8eaf0;
  font-weight: 600;
}

/* ── Toast ───────────────────────────────────────────────────────────────── */
.myday-toast { font-size: 13px; min-height: 20px; margin-bottom: 6px; }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.myday-cards-wrap { min-height: 40px; }
.myday-cards-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.myday-card {
  background: #252b3b;
  border-radius: 8px;
  padding: 12px 16px;
  border-left: 4px solid transparent;
}
.myday-card-red   { border-left-color: #dc3545; }
.myday-card-amber { border-left-color: #f0c040; }
.myday-card-green { border-left-color: #5ec97e; }

.myday-card-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}
.myday-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.myday-card-plate  { font-weight: 700; color: #e8eaf0; font-size: 14px; }
.myday-card-action { color: #c5cad8; font-size: 13px; flex: 1; }
.myday-card-deadline {
  color: #9aa3b5; font-size: 12px;
  white-space: nowrap;
}
.myday-card-reason {
  color: #9aa3b5; font-size: 12px;
  margin-bottom: 6px;
  line-height: 1.4;
}
.myday-kpi-pill {
  display: inline-block;
  background: #1e2637;
  color: #7eb8e8;
  border-radius: 4px;
  padding: 1px 8px;
  font-size: 11px;
  margin-bottom: 8px;
}
.myday-card-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.myday-btn {
  border: none;
  border-radius: 4px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  line-height: 1.6;
}
.myday-btn-doit       { background: #4a90d9; color: #fff; }
.myday-btn-doit:hover { background: #3a7bc8; color: #fff; }
.myday-btn-done       { background: #28a745; color: #fff; }
.myday-btn-done:hover { background: #218838; }
.myday-btn-snooze-open       { background: #6b7488; color: #fff; }
.myday-btn-snooze-open:hover { background: #57606f; }
.myday-btn-accept-ai         { background: #5ec97e; color: #1a2410; font-weight: 700; }
.myday-btn-accept-ai:hover   { background: #4db86d; }
.myday-btn-snooze   { background: #28a745; color: #fff; }
.myday-btn-cancel   { background: #6b7488; color: #fff; }
.myday-btn-retry    { background: #4a90d9; color: #fff; margin-top: 8px; }

/* ── Empty state ─────────────────────────────────────────────────────────── */
.myday-empty {
  text-align: center;
  padding: 32px;
  color: #9aa3b5;
}
.myday-empty-title { font-size: 15px; color: #e8eaf0; margin-top: 6px; }
.myday-empty-sub   { font-size: 12px; margin-top: 4px; }

/* ── Error state ─────────────────────────────────────────────────────────── */
.myday-error {
  text-align: center;
  padding: 24px;
  border: 1px solid #dc3545;
  border-radius: 8px;
  color: #dc3545;
}
.myday-error-msg { font-size: 14px; margin-top: 6px; }

/* ── Skeleton loading ────────────────────────────────────────────────────── */
.myday-skeleton {
  height: 80px;
  background: linear-gradient(90deg, #252b3b 25%, #2e3448 50%, #252b3b 75%);
  background-size: 200% 100%;
  animation: myday-shimmer 1.4s infinite;
  border-radius: 8px;
}
@keyframes myday-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Show more ───────────────────────────────────────────────────────────── */
.myday-show-more-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  background: transparent;
  border: 1px solid #4a90d9;
  color: #4a90d9;
  border-radius: 6px;
  padding: 6px 18px;
  cursor: pointer;
  font-size: 13px;
}
.myday-show-more-btn:hover { background: #1c2a40; }

/* ── 390px responsive ─────────────────────────────────────────────────────── */
@media (max-width: 420px) {
  .myday-widget { padding: 14px 12px; }
  .myday-kpi-strip { flex-wrap: nowrap; gap: 8px; }
  .myday-kpi-tile  { min-width: 110px; }
  .myday-card      { padding: 10px 10px; }
  .myday-card-header { gap: 4px; }
  .myday-btn { padding: 3px 8px; font-size: 11px; }
  .myday-tab { padding: 4px 10px; font-size: 12px; }
}

/* ── Snooze modal box ────────────────────────────────────────────────────── */
.myday-snooze-box { background: #252b3b; }

/* ── Light theme ──────────────────────────────────────────────────────────── */
body[data-theme="light"] .myday-widget    { background: #f0f2f5; }
body[data-theme="light"] .myday-title     { color: #1a1f2e; }
body[data-theme="light"] .myday-header-sub { color: #5a6478; }
body[data-theme="light"] .myday-kpi-tile  { background: #fff; }
body[data-theme="light"] .myday-kpi-label { color: #5a6478; }
body[data-theme="light"] .myday-kpi-value { color: #1a1f2e; }
body[data-theme="light"] .myday-card      { background: #fff; }
body[data-theme="light"] .myday-card-plate  { color: #1a1f2e; }
body[data-theme="light"] .myday-card-action { color: #3a4050; }
body[data-theme="light"] .myday-card-reason { color: #5a6478; }
body[data-theme="light"] .myday-card-deadline { color: #7a8090; }
body[data-theme="light"] .myday-kpi-pill  { background: #e8edf5; color: #2a5a90; }
body[data-theme="light"] .myday-tab       { color: #5a6478; border-color: #c5cad8; }
body[data-theme="light"] .myday-tab:hover { background: #e8edf5; color: #1a1f2e; }
body[data-theme="light"] .myday-tab-active { background: #e8edf5; color: #1a1f2e; border-color: #4a90d9; }
body[data-theme="light"] .myday-snooze-box { background: #ffffff; }
body[data-theme="light"] .myday-empty     { color: #5a6478; }
body[data-theme="light"] .myday-empty-title { color: #1a1f2e; }
body[data-theme="light"] .myday-skeleton {
  background: linear-gradient(90deg, #e8edf5 25%, #d8dde8 50%, #e8edf5 75%);
  background-size: 200% 100%;
}
