:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --green: #16a34a;
  --red: #dc2626;
  --amber: #d97706;
  --bg: #f1f5f9;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --timeoff: #2563eb;
  --event: #d97706;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--red); min-height: 1.2em; margin: 8px 0 0; }
.msg { min-height: 1.2em; margin: 8px 0 0; font-weight: 600; }
.msg.ok { color: var(--green); }
.msg.bad { color: var(--red); }

/* ---- buttons & fields ---- */
.btn {
  border: none; border-radius: 10px; padding: 11px 16px; font-size: 15px;
  font-weight: 600; cursor: pointer; background: #e2e8f0; color: var(--ink);
  transition: filter .15s ease;
}
.btn:active { filter: brightness(.93); }
.btn.primary { background: var(--blue); color: #fff; }
.btn.ghost { background: transparent; color: var(--blue); }
.btn.block { width: 100%; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.approve { background: var(--green); color: #fff; }
.btn.deny { background: var(--red); color: #fff; }
.btn.danger { background: #fee2e2; color: var(--red); }

.field { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; flex: 1; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.field input, .field select {
  font-size: 16px; padding: 11px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; color: var(--ink); width: 100%;
}
.field input:focus, .field select:focus { outline: 2px solid var(--blue); border-color: var(--blue); }
.row { display: flex; gap: 12px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px; margin: 14px 0; box-shadow: 0 1px 2px rgba(15,23,42,.04);
}

/* ---- login ---- */
.login-wrap {
  min-height: 100vh; min-height: 100dvh; display: flex; align-items: center;
  justify-content: center; padding: 20px;
  background: linear-gradient(160deg, #2563eb, #1e3a8a);
}
.login-card { width: 100%; max-width: 380px; margin: 0; }
.login-card h1 { margin: 0 0 4px; font-size: 24px; }

/* ---- topbar & tabs ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--blue); color: #fff; padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 700; font-size: 17px; }
.who { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.who .btn.ghost { color: #fff; border: 1px solid rgba(255,255,255,.5); }

.tabs {
  display: flex; gap: 4px; background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 9; overflow-x: auto; padding: 0 6px;
}
.tab {
  border: none; background: none; padding: 14px 14px; font-size: 15px;
  font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap;
  border-bottom: 3px solid transparent;
}
.tab.active { color: var(--blue); border-bottom-color: var(--blue); }
.badge {
  background: var(--red); color: #fff; border-radius: 999px; font-size: 12px;
  padding: 1px 7px; margin-left: 4px;
}

main { max-width: 720px; margin: 0 auto; padding: 12px 14px 60px; }
.section-title { font-size: 16px; margin: 22px 4px 8px; }

/* ---- calendar ---- */
.cal-header { display: flex; align-items: center; justify-content: space-between; margin: 8px 0; }
.cal-header h2 { font-size: 18px; margin: 0; }
.cal-header .btn { font-size: 22px; padding: 4px 16px; }
.legend { font-size: 13px; color: var(--muted); display: flex; gap: 14px; align-items: center; margin: 4px 4px 10px; }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 3px; vertical-align: -1px; margin-right: 2px; }
.dot.timeoff { background: var(--timeoff); }
.dot.event { background: var(--event); }

.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.cal-cell {
  background: #fff; border: 1px solid var(--line); border-radius: 8px; min-height: 56px;
  padding: 4px; font-size: 13px; cursor: pointer; display: flex; flex-direction: column; gap: 2px;
}
.cal-cell.empty { background: transparent; border: none; cursor: default; }
.cal-cell.today { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.cal-cell .num { font-weight: 600; color: var(--muted); }
.cal-cell.has-items .num { color: var(--ink); }
.cal-bar {
  font-size: 10px; line-height: 1.3; border-radius: 4px; padding: 1px 4px;
  color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-bar.timeoff { background: var(--timeoff); }
.cal-bar.event { background: var(--event); }
.cal-more { font-size: 10px; color: var(--muted); }

.day-detail { margin-top: 14px; }
.day-detail h3 { margin: 0 0 8px; font-size: 16px; }

/* ---- lists ---- */
.list { display: flex; flex-direction: column; gap: 10px; }
.item {
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px;
  display: flex; justify-content: space-between; gap: 12px; align-items: flex-start;
}
.item .who-line { font-weight: 700; }
.item .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.item .actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.pill { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.pill.pending { background: #fef3c7; color: var(--amber); }
.pill.approved { background: #dcfce7; color: var(--green); }
.pill.denied { background: #fee2e2; color: var(--red); }
.empty-state { color: var(--muted); text-align: center; padding: 30px 10px; }

/* ---- landing / signup / paywall extras ---- */
.login-card h2.mini { font-size: 15px; margin: 18px 0 4px; }
.small { font-size: 13px; }
.sep { border: none; border-top: 1px solid var(--line); margin: 20px 0 6px; }
.grow { flex: 1; }
.row .grow { font-size: 16px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; }
.login-card a { color: var(--blue); }
.btn.block + .btn.block { margin-top: 8px; }
code { background: #eef2ff; padding: 1px 6px; border-radius: 5px; font-size: 12px; word-break: break-all; }

/* ---- landing: How it works + signup, two columns ---- */
.landing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  width: 100%;
  max-width: 860px;
  align-items: start;
}
.info-card, .landing-grid .login-card { margin: 0; }
.info-card h1 { margin: 0 0 4px; font-size: 24px; }
ol.how {
  list-style: none;
  margin: 10px 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
ol.how li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.45; }
.step-n {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
@media (max-width: 720px) {
  .landing-grid { grid-template-columns: 1fr; max-width: 400px; }
}

.check { display: flex; gap: 9px; align-items: flex-start; margin: 14px 0 4px; font-size: 13px; color: #334155; line-height: 1.45; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 1px; flex-shrink: 0; }
.provider { text-align: center; margin-top: 14px; }

.trial-banner {
  background: #ecfdf5; color: #065f46; text-align: center; font-size: 13px;
  font-weight: 600; padding: 8px 12px; border-bottom: 1px solid #a7f3d0;
}

/* ---- first-login welcome tip ---- */
.tip-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(15, 23, 42, .55);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; padding-bottom: max(20px, env(safe-area-inset-bottom));
}
.tip-card {
  background: #fff; border-radius: 16px; padding: 22px;
  width: 100%; max-width: 380px;
  box-shadow: 0 12px 44px rgba(15, 23, 42, .3);
  animation: tip-pop .18s ease-out;
}
@keyframes tip-pop { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.tip-card h2 { margin: 0 0 4px; font-size: 20px; }
.tip-steps { list-style: none; margin: 16px 0 18px; padding: 0; display: flex; flex-direction: column; gap: 13px; }
.tip-steps li { display: flex; gap: 11px; font-size: 14px; line-height: 1.45; align-items: flex-start; }
.tip-steps .ic { font-size: 19px; flex-shrink: 0; line-height: 1.2; }
.card.subtle { background: #f8fafc; }

@media (max-width: 420px) {
  .cal-cell { min-height: 48px; }
  .item { flex-direction: column; }
  .item .actions { justify-content: flex-start; }
}
