:root {
  --bg: #f3f6f4;
  --bg-tint: #eef4f0;
  --card: #ffffff;
  --cream: #faf8f3;
  --ink: #1e2b28;
  --muted: #6d807b;
  --faint: #9aaaa5;
  --accent: #4f9d87;          /* calm sage-green */
  --accent-deep: #356e5e;     /* deep pine — hover, links, headings */
  --accent-soft: #e7f2ec;     /* sage mist */
  --accent-ink: #ffffff;
  --line: #e4ece8;
  --danger: #c2533f;          /* petal alert */
  --danger-soft: #fbeae6;
  --warn: #b98326;
  --warn-soft: #fbf0d8;
  --clay: #c77b53;            /* warm human accent (vacations, highlights) */
  --clay-soft: #f6e7db;
  --ok: #4f9d87;
  --ok-soft: #e1f1ea;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(31, 45, 42, .04), 0 6px 20px rgba(31, 45, 42, .05);
  --shadow-sm: 0 1px 2px rgba(31, 45, 42, .05);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  /* Ambient "aurora" lighting — large, soft, low-saturation glows that overlap
     into organic depth (modern calm look) rather than a flat fill. Fixed. */
  background:
    radial-gradient(60% 55% at 6% -8%, rgba(95, 176, 150, .34), transparent 72%),
    radial-gradient(52% 46% at 104% -2%, rgba(214, 176, 131, .26), transparent 66%),
    radial-gradient(46% 42% at 96% 108%, rgba(110, 186, 161, .24), transparent 70%),
    radial-gradient(60% 55% at 30% 118%, rgba(150, 205, 184, .20), transparent 72%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
  font-feature-settings: "tnum" 1; /* tabular figures for aligned times & money */
}
.brand, h1, h2, .hero-title { font-family: "Fraunces", Georgia, serif; }

/* Fine film grain over the whole page — subtle tactile texture so flat surfaces
   feel premium, not bare. Static, non-interactive, sits under modals. */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 60; pointer-events: none; opacity: .055;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='170'%20height='170'%3E%3Cfilter%20id='n'%3E%3CfeTurbulence%20type='fractalNoise'%20baseFrequency='0.9'%20numOctaves='2'%20stitchTiles='stitch'/%3E%3CfeColorMatrix%20type='saturate'%20values='0'/%3E%3C/filter%3E%3Crect%20width='170'%20height='170'%20filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---- top bar ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px;
  background: linear-gradient(180deg, rgba(231, 242, 236, .92), rgba(255, 255, 255, .82));
  backdrop-filter: saturate(1.5) blur(10px);
  border-bottom: 1px solid #d7e6df;
  position: sticky; top: 0; z-index: 30;
}
.brand { font-weight: 500; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; color: var(--accent-deep); }
.brand img { border-radius: 7px; display: block; }
.hero-logo { width: 72px; height: 72px; border-radius: 18px; display: block; margin: 0 auto 14px; box-shadow: var(--shadow); }
.userbox { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.app { max-width: 920px; margin: 0 auto; padding: 18px 16px 60px; }
.loading { color: var(--muted); padding: 60px 0; text-align: center; }

h1 { font-size: 23px; margin: 6px 2px 16px; letter-spacing: -0.02em; }
h2 { font-size: 16px; margin: 0 0 12px; letter-spacing: -0.01em; }
/* Sage accent bar on card titles — adds colour + structure so sections read. */
.card > h2:first-child { position: relative; padding-left: 13px; }
.card > h2:first-child::before {
  content: ""; position: absolute; left: 0; top: 1px; bottom: 1px; width: 4px;
  border-radius: 3px; background: linear-gradient(var(--accent), var(--accent-deep));
}
h3 { font-size: 14px; margin: 0 0 8px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
a { color: var(--accent-deep); }

/* ---- cards & bento ---- */
.card {
  background: var(--card);
  border: 1px solid #e3ede8;
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  /* Tight, soft green-tinted lift so cards stand off the tinted page. */
  box-shadow: 0 1px 2px rgba(31, 45, 42, .04), 0 12px 26px -14px rgba(31, 45, 42, .14);
}
.bento { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.bento .card { margin: 0; height: 100%; }
.col-2 { grid-column: span 2; }
.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
/* Colourful stat tiles. */
.tile-green { background: linear-gradient(150deg, #eaf5ef 0%, #d8ecdf 100%); border-color: #cfe6db; }
.tile-cream { background: linear-gradient(150deg, #fbf2e9 0%, #f6e7d6 100%); border-color: #eedcc8; }
.tile-tint { background: var(--bg-tint); }
.tile-green .kpi, .tile-cream .kpi { font-size: 30px; font-weight: 600; line-height: 1.05; }
.tile-green .kpi { color: var(--accent-deep); }
.tile-cream .kpi { color: #a85f37; }
@media (max-width: 720px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .col-3, .col-4 { grid-column: span 2; }
}
@media (max-width: 440px) {
  .bento { grid-template-columns: 1fr; }
  .col-2, .col-3, .col-4 { grid-column: span 1; }
}

/* ---- buttons: Apple-style capsules (flat tint, soft spring press) ---- */
button, .btn {
  font: inherit; font-weight: 600; letter-spacing: -0.01em;
  border: none;
  background: var(--accent);
  color: #fff;
  padding: 10px 18px;
  border-radius: 980px;            /* stadium / capsule — continuous & native */
  cursor: pointer;
  box-shadow: 0 1px 1.5px rgba(31, 45, 42, .12);
  transition: transform .14s cubic-bezier(.2, .7, .3, 1), filter .15s, background .15s;
  -webkit-font-smoothing: antialiased;
}
button:hover { filter: brightness(1.04); }
button:active { transform: scale(.96); }
button.ghost, .btn.ghost { background: transparent; color: var(--accent-deep); box-shadow: none; }
button.ghost:hover { background: var(--accent-soft); filter: none; }
button.subtle { background: var(--accent-soft); color: var(--accent-deep); box-shadow: none; }
button.subtle:hover { background: #dcebe2; filter: none; }
button.neutral { background: #eceeec; color: var(--ink); box-shadow: none; }
button.danger { background: var(--danger-soft); color: var(--danger); box-shadow: none; }
button.danger:hover { background: #f6dcd4; filter: none; }
button.small { padding: 7px 14px; font-size: 13px; }
button.icon { padding: 7px 10px; }
button:disabled { opacity: .45; cursor: default; transform: none; filter: none; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---- tabs: iOS segmented control ---- */
.tabs {
  display: inline-flex; flex-wrap: wrap; gap: 2px; margin-bottom: 16px; max-width: 100%;
  background: rgba(53, 110, 94, .09); border-radius: 13px; padding: 3px;
}
.tabs button {
  background: transparent; color: var(--muted);
  border: none; border-radius: 10px;
  padding: 7px 14px; font-weight: 600; font-size: 14px; box-shadow: none;
}
.tabs button:hover { background: rgba(255, 255, 255, .55); filter: none; }
.tabs button.active, .tabs button.active:hover {
  background: #fff; color: var(--accent-deep);
  box-shadow: 0 1px 3px rgba(31, 45, 42, .14), 0 1px 1px rgba(31, 45, 42, .05);
}

/* ---- forms: iOS-style soft fields ---- */
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 5px; font-weight: 500; }
input, textarea, select {
  width: 100%; min-width: 0; font: inherit;
  padding: 11px 13px;
  border: 1px solid #dfe7e3; border-radius: 12px;
  background: #f5f8f6; color: var(--ink);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
/* iOS renders time/number inputs with an intrinsic width that overflows flex
   columns — normalise them so they shrink to their box. (Not checkboxes/radios.) */
input[type="time"], input[type="date"], input[type="datetime-local"], input[type="number"] {
  -webkit-appearance: none; appearance: none; box-sizing: border-box;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent); background: #fff;
  box-shadow: 0 0 0 4px var(--accent-soft);
}
textarea { resize: vertical; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1 1 120px; min-width: 0; }

/* Settings-row label with an iOS switch on the right. */
.check {
  display: flex; flex-direction: row-reverse; justify-content: space-between; align-items: center;
  gap: 12px; margin-top: 14px; font-size: 14px; color: var(--ink); cursor: pointer; line-height: 1.4;
}
.check input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; flex: 0 0 auto; position: relative;
  width: 46px; height: 28px; border-radius: 999px; padding: 0;
  background: #d3dbd7; border: none; box-shadow: none; cursor: pointer;
  transition: background .2s ease;
}
.check input[type="checkbox"]::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 24px; height: 24px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .2s cubic-bezier(.2, .7, .3, 1);
}
.check input[type="checkbox"]:checked { background: var(--accent); }
.check input[type="checkbox"]:checked::after { transform: translateX(18px); }
.check input[type="checkbox"]:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--accent-soft); }

/* ---- lists: iOS inset-grouped rows ---- */
.list { list-style: none; padding: 0; margin: 0; }
.item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 2px; min-height: 44px; border-bottom: 1px solid #edf2ef;
}
.item:last-child { border-bottom: none; }
.item .meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.item .meta b { font-weight: 600; }

/* ---- badges / chips ---- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; padding: 2px 9px; border-radius: 999px;
  background: #eef2f0; color: var(--muted); font-weight: 500;
}
.badge.ok { background: var(--ok-soft); color: var(--accent-deep); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--danger-soft); color: var(--danger); }
.badge.dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ---- avatar ---- */
.avatar {
  width: 38px; height: 38px; border-radius: 50%; object-fit: cover;
  background: var(--accent-soft); color: var(--accent-deep);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 15px; flex: none; overflow: hidden;
}
.avatar.lg { width: 64px; height: 64px; font-size: 24px; }
.avatar.sm { width: 30px; height: 30px; font-size: 12px; }

/* ---- stats ---- */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat { background: var(--bg-tint); border-radius: var(--radius-sm); padding: 12px; }
.stat b { display: block; font-size: 20px; letter-spacing: -0.02em; }
.stat .small { color: var(--muted); }
.kpi { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }

/* ---- notice ---- */
.notice { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent-deep); font-size: 14px; margin: 0 0 12px; white-space: pre-line; }
.notice.warn { background: var(--warn-soft); color: var(--warn); }

/* ---- calendar ---- */
.cal { user-select: none; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-title { font-weight: 600; font-size: 15px; text-transform: capitalize; }
.cal-nav { display: flex; gap: 6px; }
.cal-nav button { background: var(--bg-tint); color: var(--ink); border-color: transparent; padding: 6px 12px; box-shadow: none; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { text-align: center; font-size: 11px; color: var(--faint); font-weight: 600; padding-bottom: 2px; text-transform: uppercase; letter-spacing: .03em; }
.cal-cell {
  aspect-ratio: 1 / 1; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; padding: 5px 6px; cursor: pointer;
  display: flex; flex-direction: column; gap: 3px; position: relative;
  transition: border-color .12s, background .12s;
}
.cal-cell:hover { border-color: var(--accent); }
.cal-cell.empty { background: transparent; border-color: transparent; cursor: default; }
.cal-cell.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal-cell.sel { background: var(--accent-soft); border-color: var(--accent); }
.cal-cell.has { background: var(--accent-soft); }
.cal-cell.vac { background: var(--warn-soft); }
.cal-cell.vac.has { background: repeating-linear-gradient(135deg, var(--warn-soft), var(--warn-soft) 6px, var(--accent-soft) 6px, var(--accent-soft) 12px); }
.cal-vac { position: absolute; bottom: 3px; right: 4px; font-size: 11px; line-height: 1; }
.cal-cell .d { font-size: 13px; font-weight: 600; color: var(--ink); }
.cal-cell.muted-day .d { color: var(--faint); }
.cal-dots { display: flex; flex-wrap: wrap; gap: 3px; margin-top: auto; }
.cal-dot { width: 7px; height: 7px; border-radius: 50%; }
.cal-dot.available { background: var(--accent); }
.cal-dot.booked { background: var(--warn); }
.cal-dot.blocked { background: var(--faint); }
.cal-dot.attended { background: var(--accent); }
.cal-dot.no_show { background: var(--danger); }
.cal-dot.cancelled { background: var(--faint); }
.cal-dot.upcoming { background: #6cb6f5; }
.cal-dot.m-online { background: #6cb6f5; }
.cal-dot.m-inperson { background: var(--accent); }
.cal-cnt { position: absolute; top: 4px; right: 6px; font-size: 10px; color: var(--faint); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

/* ---- misc ---- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(8px);
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px;
  font-size: 14px; opacity: 0; transition: opacity .2s, transform .2s; z-index: 200; box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.linkbox { display: flex; gap: 8px; margin-top: 12px; }
.linkbox input { font-size: 12px; }
.divider { height: 1px; background: var(--line); margin: 14px 0; border: 0; }
.back { background: none; border: none; color: var(--accent-deep); padding: 0; font-weight: 500; cursor: pointer; margin-bottom: 10px; box-shadow: none; }
.filechip { display: inline-flex; align-items: center; gap: 8px; background: var(--bg-tint); border-radius: 999px; padding: 6px 12px; font-size: 13px; margin: 4px 6px 0 0; }
.filechip a { text-decoration: none; font-weight: 500; }
.empty-state { text-align: center; color: var(--muted); padding: 30px 10px; }
.empty-state .em {
  font-size: 30px; line-height: 1; margin: 0 auto 12px;
  width: 68px; height: 68px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 38% 32%, #eef6f1, #dcecde);
  box-shadow: inset 0 0 0 1px #cfe6db;
}
.head-row { display: flex; align-items: center; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pad-list > * { margin-bottom: 8px; }
.uploadbtn { position: relative; overflow: hidden; display: inline-block; }
.uploadbtn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.modal-ov { position: fixed; inset: 0; background: rgba(20, 30, 28, .4); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; z-index: 300; padding: 16px; }
.modal {
  position: relative; background: var(--card); border-radius: 24px; padding: 22px 18px 18px;
  max-width: 420px; width: 100%; box-shadow: 0 24px 64px -20px rgba(31, 45, 42, .45);
  animation: sheet .28s cubic-bezier(.2, .7, .3, 1);
}
.modal::before {
  content: ""; position: absolute; top: 9px; left: 50%; transform: translateX(-50%);
  width: 38px; height: 5px; border-radius: 3px; background: #d8e0dc;
}
.modal h3 { margin: 6px 0 12px; }
@keyframes sheet { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
.roleswitch { display: inline-flex; background: var(--bg-tint); border-radius: 999px; padding: 3px; gap: 2px; }
.roleswitch button { background: transparent; border: none; color: var(--muted); padding: 5px 12px; border-radius: 999px; font-size: 13px; box-shadow: none; }
.roleswitch button.active { background: var(--accent); color: #fff; }
@media (max-width: 560px) { .roleswitch button { padding: 5px 9px; font-size: 12px; } .userbox .ellipsis { display: none; } }

.notice.clay { background: var(--clay-soft); color: #8a4f2e; }

/* ---- banners: iOS-notification style (material, squircle icon) ---- */
.banner {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px; border-radius: 20px; font-size: 14px; margin: 0 0 14px;
  background: rgba(231, 242, 236, .72); color: var(--accent-deep);
  border: 1px solid rgba(53, 110, 94, .14);
  box-shadow: 0 10px 30px -18px rgba(31, 45, 42, .35);
  backdrop-filter: saturate(1.5) blur(8px);
}
.banner.err { background: rgba(251, 234, 230, .75); color: var(--danger); border-color: rgba(194, 83, 63, .18); }
.banner.info { background: rgba(238, 242, 240, .8); color: var(--ink); border-color: rgba(31, 45, 42, .10); }
.banner-i {
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: 9px;  /* squircle app-icon vibe */
  display: grid; place-items: center; font-size: 15px; font-weight: 700;
  background: var(--accent); color: #fff;
}
.banner.err .banner-i { background: var(--danger); }
.banner.info .banner-i { background: var(--ink); }
.banner .grow { color: inherit; }
.banner-x {
  background: rgba(31, 45, 42, .06); border: none; color: inherit; opacity: .55;
  width: 24px; height: 24px; border-radius: 50%; padding: 0; cursor: pointer;
  font-size: 13px; box-shadow: none; display: grid; place-items: center; flex: 0 0 auto;
}
.banner-x:hover { opacity: .9; filter: none; }
.banner.flash { animation: bnr .3s cubic-bezier(.2, .7, .3, 1); }
@keyframes bnr { from { opacity: 0; transform: translateY(-6px) scale(.99); } to { opacity: 1; transform: none; } }

/* ---- skeleton loaders ---- */
.skel { height: 14px; border-radius: 7px; margin: 10px 0; background: linear-gradient(90deg, var(--accent-soft) 25%, #f1f6f3 37%, var(--accent-soft) 63%); background-size: 400% 100%; animation: shimmer 1.3s ease-in-out infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* ---- slot time chips (open-window picker) ---- */
.slotchips { display: flex; flex-wrap: wrap; gap: 8px; }
.slotchip {
  font-size: 13px; padding: 7px 12px; border-radius: 999px; cursor: pointer;
  background: var(--accent-soft); color: var(--accent-deep); border: 1px solid transparent; box-shadow: none;
}
.slotchip:hover { border-color: var(--accent); filter: none; }
.slotchip.sel { background: var(--accent); color: #fff; border-color: var(--accent); }
.slotchip.taken {
  background: #f0f2f1; color: var(--faint); cursor: default; border: 1px dashed #d6ddda;
  text-decoration: line-through; text-decoration-thickness: 1px;
}

/* ---- logged-out hero / value prop ---- */
.hero { position: relative; max-width: 620px; margin: 28px auto 6px; text-align: center; padding: 0 8px; }
/* Soft botanical blobs behind the hero for life. */
.hero::before, .hero::after {
  content: ""; position: absolute; z-index: -1; border-radius: 50%; filter: blur(8px); opacity: .55;
}
.hero::before { width: 220px; height: 220px; left: -40px; top: -30px; background: radial-gradient(circle at 40% 40%, #cfe9dd, rgba(207,233,221,0)); }
.hero::after { width: 260px; height: 260px; right: -50px; top: 40px; background: radial-gradient(circle at 50% 50%, #f0e7d3, rgba(240,231,211,0)); }
.hero-title { font-size: 30px; line-height: 1.15; letter-spacing: -0.01em; color: var(--accent-deep); margin: 0 0 12px; }
.hero-sub { color: var(--muted); font-size: 15.5px; line-height: 1.55; margin: 0 auto 18px; max-width: 540px; }
.value-list { list-style: none; padding: 0; margin: 0 auto 16px; text-align: left; max-width: 540px; display: grid; gap: 10px; }
.value-list li { background: var(--card); border: 1px solid #e3ede8; border-left: 4px solid var(--accent); border-radius: var(--radius-sm); padding: 12px 14px 12px 16px; box-shadow: 0 10px 24px -16px rgba(31,45,42,.18); }
.value-list b { display: block; font-size: 14.5px; margin-bottom: 2px; color: var(--accent-deep); }
.value-list span { color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.hero-links { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.hero-links a { text-decoration: none; padding: 6px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-deep); font-weight: 500; }
.hero-illustration { display: block; width: min(440px, 88%); height: auto; margin: 26px auto 2px; }

/* ---- a11y: visible focus + validation + reduced motion ---- */
input.input-err, textarea.input-err, select.input-err { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:focus-visible, .slotchip:focus-visible, a:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }
