/* Family Task Center: light glass theme, shared by the Dashboard and the App. */
:root {
  --ink: #1c2333; --muted: #6a7590; --faint: #98a2b8;
  --accent: #4f7cff; --accent2: #7b5cff; --good: #1fb27a; --bad: #e5484d; --warn: #f59f0b;
  --glass: rgba(255, 255, 255, .58); --glass-strong: rgba(255, 255, 255, .78); --glass-soft: rgba(255, 255, 255, .38);
  --edge: rgba(255, 255, 255, .85); --line: rgba(28, 35, 51, .08);
  --shadow: 0 10px 34px rgba(40, 56, 110, .10), 0 2px 6px rgba(40, 56, 110, .05);
  --blur: blur(22px) saturate(170%);
  --r: 22px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: #eef2fa; }
/* Soft colour wash behind the glass (fixed layer works on iOS too). */
body::before {
  content: ""; position: fixed; inset: -10%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(38% 42% at 12% 10%, #bcd3ff 0%, transparent 70%),
    radial-gradient(34% 40% at 88% 6%, #ffd3e8 0%, transparent 70%),
    radial-gradient(40% 44% at 80% 92%, #c9f2e1 0%, transparent 70%),
    radial-gradient(36% 40% at 8% 88%, #fff0c4 0%, transparent 70%),
    radial-gradient(30% 34% at 50% 50%, #e3dcff 0%, transparent 75%),
    #eef2fa;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }

.glass {
  background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--edge); border-radius: var(--r); box-shadow: var(--shadow);
}
.glass-soft { background: var(--glass-soft); border: 1px solid rgba(255,255,255,.6); border-radius: 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff;
  border-radius: 14px; padding: 12px 18px; font-weight: 650; box-shadow: 0 6px 18px rgba(79, 124, 255, .28);
  transition: transform .12s, box-shadow .12s;
}
.btn:active { transform: scale(.97); }
.btn.ghost { background: var(--glass-strong); color: var(--ink); box-shadow: 0 2px 8px rgba(40,56,110,.08); border: 1px solid var(--edge); }
.btn.good { background: linear-gradient(135deg, #22c38a, #14a3a0); box-shadow: 0 6px 18px rgba(31, 178, 122, .3); }
.btn.danger { background: rgba(229, 72, 77, .1); color: var(--bad); box-shadow: none; }
.btn.small { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn:disabled { opacity: .5; }
.iconbtn { width: 36px; height: 36px; border-radius: 12px; display: inline-grid; place-items: center; color: var(--muted); font-size: 18px; }
.iconbtn:active { background: var(--glass-strong); }

input[type=text], input[type=password], input[type=date], input[type=time], textarea, select {
  width: 100%; border: 1px solid var(--edge); background: rgba(255,255,255,.72); border-radius: 14px;
  padding: 12px 14px; outline: none; box-shadow: inset 0 1px 2px rgba(40,56,110,.06);
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(79, 124, 255, .15); }
label.field { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin: 16px 0 7px; text-transform: uppercase; letter-spacing: .5px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 14px; border-radius: 999px; background: rgba(255,255,255,.55); border: 1.5px solid var(--edge);
  font-weight: 600; font-size: 14px; color: var(--ink);
}
.chip.on { background: var(--c, var(--accent)); border-color: transparent; color: #fff; box-shadow: 0 4px 12px color-mix(in srgb, var(--c, var(--accent)) 35%, transparent); }
.chip.day { width: 42px; padding: 8px 0; text-align: center; }

.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  font-weight: 700; font-size: 14px; flex: none; background: var(--c, #98a2b8);
  box-shadow: 0 4px 10px color-mix(in srgb, var(--c, #98a2b8) 40%, transparent), inset 0 1px 0 rgba(255,255,255,.35);
}

/* Check circle used for tasks and chores */
.check {
  width: 30px; height: 30px; border-radius: 50%; border: 2.5px solid var(--c, var(--accent)); flex: none;
  display: grid; place-items: center; color: #fff; background: rgba(255,255,255,.6); transition: .15s;
}
.check svg { width: 16px; height: 16px; opacity: 0; }
.is-done .check { background: var(--c, var(--accent)); }
.scanhint { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(79,124,255,.08); color: var(--accent); font-weight: 600; font-size: 14px; }
.is-done .check svg { opacity: 1; }
.is-done .item-title { text-decoration: line-through; color: var(--faint); }

.item { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 16px; }
.item + .item { border-top: 1px solid var(--line); border-radius: 0; }
.item-body { flex: 1; min-width: 0; }
.item-title { font-weight: 600; line-height: 1.3; word-wrap: break-word; }
.item-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 3px; font-size: 13px; color: var(--muted); }
.item-meta .over { color: var(--bad); font-weight: 600; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(79,124,255,.1); color: var(--accent); }
.tag.daily { background: rgba(31,178,122,.12); color: #12875b; }
.pts { color: #b7791f; font-weight: 700; }

.section-title { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; margin: 18px 6px 8px; display: flex; align-items: center; gap: 8px; }
.section-title .count { margin-left: auto; font-weight: 700; letter-spacing: 0; text-transform: none; }
.empty { text-align: center; color: var(--muted); padding: 22px 16px; font-size: 14px; }
.muted { color: var(--muted); }

.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(255,255,255,.45); border: 1px solid var(--edge); }
.seg button { white-space: nowrap; padding: 8px 14px; border-radius: 10px; font-weight: 650; font-size: 14px; color: var(--muted); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(40,56,110,.12); }

.progress { height: 8px; border-radius: 999px; background: rgba(28,35,51,.07); overflow: hidden; }
.progress > div { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--c, var(--good)), color-mix(in srgb, var(--c, var(--good)) 60%, #fff)); transition: width .4s; }

/* Sheet: bottom sheet on phones, centred dialog on wide screens */
.sheet-bg { position: fixed; inset: 0; background: rgba(30, 40, 70, .22); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); z-index: 60; opacity: 0; pointer-events: none; transition: opacity .2s; }
.sheet-bg.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; max-height: 92vh; overflow: auto;
  background: rgba(248, 250, 255, .88); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border-top: 1px solid var(--edge); border-radius: 26px 26px 0 0; box-shadow: 0 -10px 40px rgba(40,56,110,.15);
  padding: 10px 20px calc(20px + env(safe-area-inset-bottom)); transform: translateY(105%); transition: transform .3s cubic-bezier(.2,.8,.2,1);
}
.sheet::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 9px; background: rgba(28,35,51,.15); margin: 0 auto 12px; }
.sheet.open { transform: none; }
.sheet h2 { margin: 0 0 2px; font-size: 21px; letter-spacing: -.3px; }
.sheet .actions { display: flex; gap: 10px; margin-top: 22px; }
.sheet .actions .btn { flex: 1; padding: 14px; font-size: 16px; }
.sheet .stack .btn { width: 100%; margin-top: 10px; padding: 14px; }
@media (min-width: 760px) {
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: 540px; border-radius: 26px; border: 1px solid var(--edge);
    transform: translate(-50%, -46%) scale(.97); opacity: 0; pointer-events: none; transition: .22s; padding: 24px 26px; }
  .sheet::before { display: none; }
  .sheet.open { transform: translate(-50%, -50%); opacity: 1; pointer-events: auto; }
}
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; margin-top: 16px; font-weight: 600; border-radius: 14px; background: rgba(255,255,255,.6); border: 1px solid var(--edge); }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: rgba(28,35,51,.15); transition: .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.2); transition: .2s; }
.switch input:checked + span { background: var(--good); }
.switch input:checked + span::after { transform: translateX(20px); }

.toast {
  position: fixed; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); z-index: 100;
  display: flex; align-items: center; gap: 14px; padding: 12px 14px 12px 18px; border-radius: 16px; font-weight: 600; max-width: 92vw;
  background: rgba(28, 35, 51, .86); color: #fff; -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  opacity: 0; pointer-events: none; transition: .25s; box-shadow: 0 10px 30px rgba(0,0,0,.2);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast.bad { background: rgba(229, 72, 77, .92); }
.toast button { color: #9db8ff; font-weight: 700; padding: 4px 6px; }

.offline-bar { display: none; position: fixed; top: 0; left: 0; right: 0; z-index: 200; background: var(--bad); color: #fff; text-align: center; padding: calc(6px + env(safe-area-inset-top)) 6px 6px; font-size: 13px; font-weight: 600; }
body.offline .offline-bar { display: block; }

/* Calendar */
.cal-head { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.cal-title { font-size: 19px; font-weight: 750; letter-spacing: -.3px; min-width: 150px; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-wd { text-align: center; font-size: 11px; font-weight: 800; color: var(--muted); letter-spacing: .6px; padding-bottom: 2px; }
.cal-day { min-height: 92px; border-radius: 14px; background: rgba(255,255,255,.5); border: 1px solid rgba(255,255,255,.75); padding: 6px; text-align: left;
  display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.cal-day .num { font-weight: 700; font-size: 14px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; }
.cal-day.other { opacity: .45; }
.cal-day.today .num { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; }
.cal-day.sel { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,124,255,.18); background: rgba(255,255,255,.85); }
.cal-ev { font-size: 11.5px; font-weight: 650; padding: 2px 6px; border-radius: 6px; background: color-mix(in srgb, var(--c) 14%, transparent); color: color-mix(in srgb, var(--c) 80%, #000);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-more { font-size: 11px; color: var(--muted); font-weight: 600; padding-left: 4px; }
.cal.compact .cal-day { min-height: 46px; align-items: center; padding: 4px 2px; gap: 2px; }
.cal.compact .cal-grid { gap: 4px; }
.cal-dots { display: flex; gap: 3px; height: 6px; }
.cal-dots i { width: 6px; height: 6px; border-radius: 50%; }
.cal-dots i.task { background: transparent; border: 1.5px solid var(--muted); width: 5px; height: 5px; border-radius: 1px; }
.agenda-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.agenda-head .btn { margin-left: auto; }
.agenda-day { font-size: 19px; font-weight: 750; letter-spacing: -.3px; }
.agenda-ev { cursor: pointer; }
.agenda-time { width: 70px; flex: none; font-weight: 700; font-size: 13px; color: var(--accent); }

.prio { font-size: 11.5px; font-weight: 800; padding: 1px 8px; border-radius: 999px; letter-spacing: .2px; }
.prio.high { background: rgba(229,72,77,.12); color: #c22f35; }
.prio.low { background: rgba(28,35,51,.06); color: var(--muted); }
