/*
 * theme.css — CleanFlow's design-system values.
 * Corporate + Swiss: small radii, hairline borders, one quiet shadow tier,
 * a navy accent on white. Opens light; the same system in a dark ground
 * lives under html[data-theme="dark"] for the layout's own switch.
 */

:root {
  --canvas: #ffffff;
  --surface: #ffffff;
  --surface-2: #f3f6fa;
  --border: #e2e7ee;
  --border-strong: #c7d0dc;
  --ink: #1f2937;
  --muted: #666c72;

  --accent: #0f6e5c;
  --accent-hover: #0c5b4c;
  --accent-ink: #ffffff;
  --accent-text: #0f6e5c;
  --accent-strong: #0f6e5c;
  --accent-soft: #e6f2ef;
  --accent-border: #b7ded4;

  --success: #178a4c;
  --success-ink: #ffffff;
  --success-soft: #e4f5ea;
  --success-strong: #146b3c;

  --warning: #b3720a;
  --warning-ink: #ffffff;
  --warning-soft: #faefda;
  --warning-strong: #925c07;

  --danger: #c0362c;
  --danger-ink: #ffffff;
  --danger-soft: #fbe6e4;
  --danger-strong: #a12b22;

  --chart-1: #0f6e5c;
  --chart-2: #b3720a;
  --chart-3: #178a4c;
  --chart-4: #c0362c;
  --chart-5: #7452b0;
  --chart-6: #946200;

  --font-display: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-sans: "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --display-weight: 700;
  --display-tracking: -0.01em;
  --eyebrow-tracking: 0.04em;

  --radius-btn: 6px;
  --radius-card: 8px;
  --radius-input: 6px;
  --border-w: 1px;
  --border-strong-w: 1px;
  --shadow-card: 0 1px 2px color-mix(in srgb, var(--ink) 7%, transparent);
  --shadow-raised: 0 8px 24px color-mix(in srgb, var(--ink) 14%, transparent);
  --shadow-btn: none;
  --card-pad: 1.5rem;
  --caps: none;
  --caps-tracking: 0.02em;
  --btn-weight: 600;
  --measure: 65ch;

  /* App-specific: status badge for "Rescheduled" (purple), and the rail's own ground. */
  --x-purple-soft: #efe9fb;
  --x-purple-strong: #5a3a94;
  --x-rail-bg: #16283f;
  --x-rail-border: #24405f;
  --x-rail-ink: #f3f6fa;
  --x-rail-muted: #93a6bd;
  --x-rail-active-bg: #0f6e5c;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #10161d;
  --surface: #171f28;
  --surface-2: #1e2933;
  --border: #2a3743;
  --border-strong: #40505f;
  --ink: #eef2f6;
  --muted: #a9b4c0;

  --accent: #2f9c82;
  --accent-hover: #3aab90;
  --accent-ink: #06120f;
  --accent-text: #6fd6b8;
  --accent-strong: #8ee6cb;
  --accent-soft: #123a30;
  --accent-border: #2a5c4e;

  --success: #2fa968;
  --success-ink: #0c1117;
  --success-soft: #143224;
  --success-strong: #7ad8a4;

  --warning: #d4923a;
  --warning-ink: #0c1117;
  --warning-soft: #3a2c14;
  --warning-strong: #e8bd7c;

  --danger: #d76b5f;
  --danger-ink: #0c1117;
  --danger-soft: #3a1e1a;
  --danger-strong: #f0a196;

  --chart-1: #6fd6b8;
  --chart-2: #e8bd7c;
  --chart-3: #7ad8a4;
  --chart-4: #e8a89b;
  --chart-5: #c3aeea;
  --chart-6: #d4923a;

  /* App-specific tokens stay put — the rail is a fixed dark ground in either mode. */
  --x-purple-soft: #2a2140;
  --x-purple-strong: #c3aeea;
  --x-rail-bg: #16283f;
  --x-rail-border: #24405f;
  --x-rail-ink: #f3f6fa;
  --x-rail-muted: #93a6bd;
  --x-rail-active-bg: #0f6e5c;
}

/*
 * app.css — CleanFlow's own screens: the left navigation rail, the
 * day/week/month segmented control, the schedule timeline rail, and the one
 * moment that moves — the create-job success confirmation.
 */

/* ---------------------------------------------------------------- rail -- */
.rail-layout { display: flex; min-height: 100vh; }

.rail {
  position: fixed;
  inset-block: 0;
  left: 0;
  z-index: 20;
  display: flex;
  width: 15.5rem;
  flex-direction: column;
  gap: 1.25rem;
  overflow-y: auto;
  background: var(--x-rail-bg);
  border-right: 1px solid var(--x-rail-border);
  padding: 1.25rem 1rem 1.5rem;
}

.rail-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.25rem 0.25rem 0.75rem;
  border-bottom: 1px solid var(--x-rail-border);
  text-decoration: none;
}
.rail-brand-mark {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  border-radius: var(--radius-card, 8px);
  background: var(--x-rail-active-bg);
  color: var(--x-rail-ink);
}
.rail-brand-text { display: flex; flex-direction: column; min-width: 0; }
.rail-brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--x-rail-ink);
  letter-spacing: var(--display-tracking);
}
.rail-brand-tag { font-size: 0.7rem; line-height: 1.25; color: var(--x-rail-muted); white-space: normal; }

.rail-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.5rem;
  border-radius: var(--radius-btn, 6px);
  background: var(--x-rail-ink);
  color: var(--x-rail-bg);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  transition: opacity 150ms;
}
.rail-cta:hover { opacity: 0.88; text-decoration: none; }
.rail-cta .icon { flex-shrink: 0; }

.rail-nav { display: flex; flex-direction: column; gap: 0.125rem; }
.rail-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 2.5rem;
  padding-inline: 0.65rem;
  border-radius: var(--radius-btn, 6px);
  color: var(--x-rail-muted);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 150ms, color 150ms;
}
.rail-link:hover { background: color-mix(in srgb, var(--x-rail-ink) 8%, transparent); color: var(--x-rail-ink); text-decoration: none; }
.rail-link.is-active { background: var(--x-rail-active-bg); color: var(--x-rail-ink); font-weight: 600; }
.rail-link .icon { flex-shrink: 0; }
.rail-badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding-inline: 0.3rem;
  border-radius: 999px;
  background: var(--danger);
  color: var(--danger-ink);
  font-size: 0.68rem;
  font-weight: 700;
}

.rail-foot {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 2.5rem;
  padding-inline: 0.65rem;
  border-top: 1px solid var(--x-rail-border);
  padding-top: 0.85rem;
  margin-top: 0.25rem;
  color: var(--x-rail-muted);
  font-size: 0.8rem;
  text-decoration: none;
}
.rail-foot:hover { color: var(--x-rail-ink); text-decoration: none; }

.rail-main { flex: 1; min-width: 0; margin-left: 15.5rem; padding: 2rem 2.25rem 4rem; }

@media (width < 62rem) {
  .rail { width: 4.5rem; padding-inline: 0.6rem; align-items: center; }
  .rail-brand { justify-content: center; padding-inline: 0; border-bottom: none; }
  .rail-brand-text { display: none; }
  .rail-cta { width: 2.5rem; padding: 0; }
  .rail-cta .rail-label { display: none; }
  .rail-link { justify-content: center; padding-inline: 0; width: 2.5rem; }
  .rail-label { display: none; }
  .rail-badge { position: absolute; top: 0.25rem; right: 0.25rem; margin-left: 0; min-width: 0.9rem; height: 0.9rem; font-size: 0; padding: 0; }
  .rail-foot { justify-content: center; padding-inline: 0; }
  .rail-main { margin-left: 4.5rem; padding: 1.5rem 1.25rem 3rem; }
}

@media (width < 30rem) {
  .rail-main { padding: 1.25rem 1rem 3rem; }
}

/* ------------------------------------------------------- job status dot -- */
.status-dot { display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 999px; background: currentColor; }

/* --------------------------------------------------------- segmented ---- */
.segmented { display: inline-flex; padding: 0.2rem; gap: 0.15rem; border: 1px solid var(--border); border-radius: var(--radius-btn, 6px); background: var(--surface-2); }
.segmented-item {
  display: inline-flex; align-items: center; justify-content: center;
  height: 2rem; padding-inline: 0.9rem; border-radius: calc(var(--radius-btn, 6px) - 2px);
  font-size: 0.8125rem; font-weight: 600; color: var(--muted); text-decoration: none; white-space: nowrap;
}
.segmented-item:hover { color: var(--ink); text-decoration: none; }
.segmented-item.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-card); }

/* --------------------------------------------------------- timeline ----- */
.timeline { position: relative; display: flex; flex-direction: column; }
.timeline-row { position: relative; display: flex; gap: 1rem; padding-block: 0.9rem; border-bottom: 1px solid var(--border); }
.timeline-row:last-child { border-bottom: none; }
.timeline-time { flex: 0 0 5rem; font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); padding-top: 0.15rem; }

/* ------------------------------------------------- create-job success --- */
@keyframes job-success-pop {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
@keyframes job-success-ring {
  from { transform: scale(0.6); opacity: 0; }
  60%  { opacity: 1; }
  to   { transform: scale(1); opacity: 1; }
}
.job-success { animation: job-success-pop 420ms var(--ease-out, ease) both; }
.job-success .job-success-icon { animation: job-success-ring 420ms 80ms var(--ease-out, ease) both; }
html.reduced-motion .job-success,
html.reduced-motion .job-success .job-success-icon { animation: none; }

/* --------------------------------------------------------- cleaner grid - */
.cleaner-photo { position: relative; }
.cleaner-status-dot {
  position: absolute; top: 0.6rem; right: 0.6rem; width: 0.65rem; height: 0.65rem; border-radius: 999px;
  border: 2px solid var(--surface);
}

/* ------------------------------------------------------------- sign-in - */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.login-card { width: 100%; max-width: 22rem; }
.login-brand { display: flex; align-items: center; gap: 0.75rem; }
.login-mark {
  display: grid; place-items: center; width: 2.75rem; height: 2.75rem; flex-shrink: 0;
  border-radius: var(--radius-card, 8px); background: var(--accent); color: var(--accent-ink);
}
.login-name { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; letter-spacing: var(--display-tracking); }
.login-tag { font-size: 0.78rem; color: var(--muted); }
.login-heading { margin-top: 1.5rem; font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; letter-spacing: var(--display-tracking); }
.login-foot { margin-top: 1.5rem; text-align: center; font-size: 0.8rem; color: var(--muted); }

/* ---------------------------------------------------------- rail: account */
.rail-account { display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0.65rem; border-top: 1px solid var(--x-rail-border); }
.rail-account-avatar {
  display: grid; place-items: center; width: 2rem; height: 2rem; flex-shrink: 0; border-radius: 999px;
  background: var(--x-rail-active-bg); color: var(--x-rail-ink); font-family: var(--font-display); font-weight: 700; font-size: 0.8rem;
}
.rail-account-name { font-size: 0.8125rem; font-weight: 600; color: var(--x-rail-ink); line-height: 1.2; }
.rail-account-email { font-size: 0.7rem; color: var(--x-rail-muted); line-height: 1.2; }
.rail-account-info { min-width: 0; flex: 1; }
.rail-account-info p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-logout {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 1.9rem; height: 1.9rem;
  border-radius: var(--radius-btn, 6px); color: var(--x-rail-muted); background: transparent; border: none; cursor: pointer;
}
.rail-logout:hover { background: color-mix(in srgb, var(--x-rail-ink) 8%, transparent); color: var(--x-rail-ink); }

@media (width < 62rem) {
  .rail-account { justify-content: center; padding-inline: 0; }
  .rail-account-info { display: none; }
}
