/* Lucky's Schedule Hub — house style.
   Human first: a tired manager on a phone must know what to do in 5 seconds. */

:root {
  --bg:      #F4F5F7;
  --surface: #FFFFFF;
  --surface2:#F8F9FB;
  --border:  #ECEEF2;
  --text:    #191B22;
  --muted:   #6F7480;
  --faint:   #9CA1AC;
  --accent:  #6558F5;
  --accent-soft: #EFEDFE;
  --good: #17A34A;  --good-soft: #E8F7EE;
  --bad:  #DC2626;  --bad-soft:  #FDEDEC;
  --warn: #B45309;  --warn-soft: #FEF4E0;
  --shadow: 0 1px 3px rgba(16,24,40,.07);
  --shadow-lift: 0 4px 14px rgba(16,24,40,.10);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "SF Pro Text", "Segoe UI", Inter, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }

/* ── Layout ─────────────────────────────────────────────────────────────── */
.wrap { max-width: 860px; margin: 0 auto; padding: 0 20px 80px; }

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 40;
}
.topbar-in {
  max-width: 860px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; gap: 12px;
}
.topbar h1 { font-size: 20px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.topbar .sub { font-size: 13px; color: var(--muted); margin-top: 1px; }
.spacer { flex: 1; }

/* ── Tabs ───────────────────────────────────────────────────────────────── */
.tabs {
  display: flex; gap: 4px; overflow-x: auto; padding: 10px 0 0;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  background: none; border: 0; cursor: pointer; white-space: nowrap;
  padding: 10px 14px; border-radius: 999px; font-weight: 600; font-size: 14px;
  color: var(--muted); min-height: 44px;
}
.tab:hover { color: var(--text); }
.tab.on { background: var(--accent-soft); color: var(--accent); }

/* ── Cards ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface); border-radius: 16px; box-shadow: var(--shadow);
  padding: 20px; margin-bottom: 12px;
}
.card.tight { padding: 14px 16px; }
.section-title { font-size: 13px; font-weight: 600; color: var(--faint); margin: 28px 0 10px; }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent;
  background: var(--surface); color: var(--text); font-weight: 600; cursor: pointer;
  border-color: var(--border);
}
.btn:hover { background: var(--surface2); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--bad); border-color: var(--border); background: var(--surface); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Inputs ─────────────────────────────────────────────────────────────── */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.input, select.input, textarea.input {
  width: 100%; min-height: 44px; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  outline: none; appearance: none;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select.input {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236F7480' stroke-width='2.5' stroke-linecap='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px;
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── Chips & pills ──────────────────────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface2); color: var(--muted);
}
.chip.good { background: var(--good-soft); color: var(--good); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad  { background: var(--bad-soft);  color: var(--bad); }
.chip.accent { background: var(--accent-soft); color: var(--accent); }

/* ── Day rows (the schedule grid) ───────────────────────────────────────── */
.day {
  display: flex; gap: 14px; padding: 14px 16px;
  background: var(--surface); border-radius: 16px; margin-bottom: 8px;
  box-shadow: var(--shadow);
}
.day.past { background: var(--surface2); box-shadow: none; }
.day.today { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.day-date { width: 58px; flex-shrink: 0; text-align: center; }
.day-dow { font-size: 12px; font-weight: 600; color: var(--faint); text-transform: uppercase; }
.day-num { font-size: 22px; font-weight: 700; line-height: 1.15; }
.day-slots { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }

.slot {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: var(--surface2); border: 1px solid transparent; border-radius: 12px;
  padding: 9px 12px; cursor: pointer; text-align: left; min-height: 44px;
}
.slot:hover { border-color: var(--border); background: var(--surface); box-shadow: var(--shadow); }
.slot-tag {
  font-size: 11px; font-weight: 700; color: var(--faint);
  width: 62px; flex-shrink: 0; text-transform: uppercase; letter-spacing: .02em;
}
.slot-body { flex: 1; min-width: 0; }
.slot-name { font-weight: 600; }
.slot-name.empty { color: var(--faint); font-weight: 400; }
.slot-time { font-size: 13px; color: var(--muted); }
.slot-hrs { font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; }
.slot-actual { font-size: 12px; color: var(--faint); margin-top: 2px; }
.week-break {
  display: flex; align-items: center; gap: 10px;
  margin: 20px 2px 8px; font-size: 12px; font-weight: 600; color: var(--faint);
}
.week-break::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ── Detail rows ────────────────────────────────────────────────────────── */
.drow {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.drow:last-child { border-bottom: 0; }
.drow .k { color: var(--muted); font-size: 14px; }
.drow .v { margin-left: auto; font-weight: 600; text-align: right; }

/* ── Banners ────────────────────────────────────────────────────────────── */
.banner { padding: 12px 16px; border-radius: 12px; font-size: 14px; margin-bottom: 12px; }
.banner.info { background: var(--accent-soft); color: #3C31C4; }
.banner.good { background: var(--good-soft); color: #15803D; }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.bad  { background: var(--bad-soft);  color: var(--bad); }

/* ── Empty state ────────────────────────────────────────────────────────── */
.empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty h3 { margin: 0 0 6px; font-size: 17px; color: var(--text); }
.empty p { margin: 0 0 18px; font-size: 14px; }

/* ── Modal ──────────────────────────────────────────────────────────────── */
.scrim {
  position: fixed; inset: 0; background: rgba(16,24,40,.42);
  display: flex; align-items: flex-end; justify-content: center; z-index: 60;
}
@media (min-width: 600px) { .scrim { align-items: center; } }
.sheet {
  background: var(--surface); width: 100%; max-width: 480px;
  border-radius: 20px 20px 0 0; padding: 24px; box-shadow: var(--shadow-lift);
  max-height: 88vh; overflow-y: auto;
}
@media (min-width: 600px) { .sheet { border-radius: 20px; } }
.sheet h2 { margin: 0 0 4px; font-size: 19px; font-weight: 700; }
.sheet .sheet-sub { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.sheet-actions { display: flex; gap: 10px; margin-top: 22px; }
.sheet-actions .btn { flex: 1; }

/* ── Toast ──────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: #191B22; color: #fff; padding: 12px 20px; border-radius: 12px;
  font-size: 14px; font-weight: 600; z-index: 80; box-shadow: var(--shadow-lift);
}
.toast.bad { background: var(--bad); }

/* ── Table (hours) ──────────────────────────────────────────────────────── */
.tscroll { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th {
  text-align: left; font-size: 12px; color: var(--faint); font-weight: 600;
  padding: 0 12px 10px 0; white-space: nowrap;
}
table.t td { padding: 11px 12px 11px 0; border-top: 1px solid var(--border); white-space: nowrap; }
table.t td.num { font-variant-numeric: tabular-nums; color: var(--muted); }
table.t td.over { color: var(--bad); font-weight: 700; }
table.t td.name { font-weight: 600; }

.muted { color: var(--muted); }
.hide { display: none !important; }
