:root {
  --bg: #0f0f0f;
  --ink: #ececec;
  --muted: #9ca3af;
  --subtle: #6b7280;
  --line: #282828;
  --accent: #60a5fa;
  --accent-bg: rgba(96, 165, 250, 0.1);
  --today-ring: #60a5fa;
  --off-color: #6b7280;
  --warn: #fbbf24;
  --card-bg: #181818;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  --radius: 12px;

  /* Shift type colors */
  --shift-morning: #f59e0b;
  --shift-evening: #8b5cf6;
  --shift-full: #ef4444;
  --shift-off: #374151;
  --shift-non-standard: #14b8a6;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, "SF Pro Text", "Helvetica Neue", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

main {
  width: min(520px, calc(100% - 1.5rem));
  margin: 0 auto;
  padding: 1rem 0 4rem;
}

/* ── Header ── */

.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 1rem 0 0.75rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.75rem;
}

.header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.next-shift {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.next-shift strong {
  color: var(--ink);
  font-weight: 600;
}

.header-right {
  display: flex;
  gap: 1rem;
  text-align: right;
}

.stat {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.stat small {
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--muted);
}

/* ── Issues ── */

.issue {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
  border-radius: var(--radius);
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.25);
  font-size: 0.82rem;
  color: var(--warn);
}

.issue-dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--warn);
}

.issue-dot-error {
  background: #ef4444;
}

.day-scheduled-label {
  font-size: 0.75rem;
  color: var(--subtle);
  font-variant-numeric: tabular-nums;
}

/* ── Timeline ── */

.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Week group ── */

.week-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 0.25rem;
}

.week-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.5rem 0.25rem;
  margin-top: 0.5rem;
}

.week-group:first-child .week-header {
  margin-top: 0;
}

.week-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--subtle);
}

.week-total {
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

/* ── Today marker ── */

.today-marker {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
}

.today-marker span {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.today-marker::after {
  content: "";
  flex: 1;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

/* ── Day card ── */

.day {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius);
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  transition: box-shadow 0.15s ease;
}

.day:hover {
  box-shadow: var(--shadow);
}

.day-today {
  border-color: var(--today-ring);
  border-width: 2px;
  border-left-width: 4px;
  background: var(--accent-bg);
}

.day-past {
  opacity: 0.7;
}

.day-past:hover {
  opacity: 1;
}

/* ── Shift type left border colors ── */

.day-shift-morning {
  border-left-color: var(--shift-morning);
}

.day-shift-evening {
  border-left-color: var(--shift-evening);
}

.day-shift-full {
  border-left-color: var(--shift-full);
}

.day-shift-off {
  border-left-color: var(--shift-off);
}

/* Non-standard shifts get a dashed left border */
.day-non-standard {
  border-left-style: dashed;
  border-left-width: 4px;
}

/* Shift type badge */
.shift-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 5px;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 0.4rem;
}

.shift-badge-morning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--shift-morning);
}

.shift-badge-evening {
  background: rgba(139, 92, 246, 0.15);
  color: var(--shift-evening);
}

.shift-badge-full {
  background: rgba(239, 68, 68, 0.12);
  color: var(--shift-full);
}

.day-today .day-shift-morning,
.day-today.day-shift-morning {
  border-left-color: var(--shift-morning);
}

.day-today .day-shift-evening,
.day-today.day-shift-evening {
  border-left-color: var(--shift-evening);
}

.day-today .day-shift-full,
.day-today.day-shift-full {
  border-left-color: var(--shift-full);
}

/* ── Day inner layout ── */

.day-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.day-date {
  font-size: 0.92rem;
  font-weight: 600;
}

.day-schedule {
  font-size: 0.85rem;
  color: var(--muted);
}

.day-off {
  font-size: 0.82rem;
  color: var(--off-color);
  font-style: italic;
}

.day-details {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  margin-top: 2px;
}

.day-punches {
  font-size: 0.82rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.day-today .day-punches {
  color: var(--accent);
}

.day-break {
  font-size: 0.78rem;
  color: var(--subtle);
}

.day-note {
  font-size: 0.82rem;
  color: var(--warn);
  font-weight: 500;
}

.day-total {
  flex-shrink: 0;
  font-size: 0.88rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  padding-top: 1px;
}

.day-today .day-total {
  color: var(--accent);
}

/* ── Legend ── */

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.5rem 0;
  margin-bottom: 0.25rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}

.legend-bar {
  width: 14px;
  height: 4px;
  border-radius: 2px;
}

.legend-bar-morning { background: var(--shift-morning); }
.legend-bar-evening { background: var(--shift-evening); }
.legend-bar-full { background: var(--shift-full); }
.legend-bar-off { background: var(--shift-off); }

.legend-bar-dashed {
  width: 14px;
  height: 0;
  border-top: 2px dashed var(--shift-non-standard);
}

/* ── Empty state ── */

.empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}

/* ── Loading state ── */

.app-loading {
  opacity: 0.5;
}

/* ── Responsive ── */

@media (max-width: 520px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .header-right {
    gap: 0.75rem;
  }

  .day {
    padding: 0.65rem 0.7rem;
  }
}
