/* Moulana Creative Ops — design system (see mockups/home.html) */

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --forest: #2e4d3d;
  --forest-2: #3b5f4c;
  --sage: #527f5b;
  --moss: #a3c9a8;
  --mint: #dcead9;
  --cream: #f7f7f2;
  --bg: #f2f3ec;
  --surface: #ffffff;
  --ink: #1c2620;
  --ink-2: #5b665f;
  --ink-3: #8c968f;
  --line: #e6e9e1;
  --clay: #b4573e;
  --clay-soft: #f7e9e4;
  --sand: #9a7b3f;
  --sand-soft: #f5eedf;
  --slate: #4d6577;
  --slate-soft: #e7edf1;
  --teal: #3e6b63;
  --teal-soft: #e6f0ed;
  --forest-ink: #2e4d3d;
  --sage-ink: #527f5b;
  --clay-ink: #b4573e;
  --mint-2: #cfe3cb;
  --sage-soft: #e6efe1;
  --moss-soft: #edf3e4;
  --moss-ink: #5b7a3e;
  --hover: #fbfbf8;
  --hover-nav: rgba(220, 234, 217, 0.6);
  --track: #d6ddd3;
  --dash: #d3dccf;
  --glass: rgba(247, 247, 242, 0.88);
  --glass-2: rgba(255, 255, 255, 0.94);
  --a5: #c9d8c4;
  --serif: "Newsreader", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --shadow: 0 1px 2px rgba(46, 77, 61, 0.04), 0 6px 20px -8px rgba(46, 77, 61, 0.14);
  --shadow-lg: 0 24px 60px -16px rgba(28, 38, 32, 0.35);
  --radius: 24px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}

/* Night mode: follows the device unless the person picked Light or Dark. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --forest: #3d6650;
  --forest-2: #4a7660;
  --sage: #4f7d59;
  --moss: #7fa886;
  --mint: #24382c;
  --cream: #121813;
  --bg: #121813;
  --surface: #1a221d;
  --ink: #e6ece7;
  --ink-2: #a7b2aa;
  --ink-3: #7b877f;
  --line: #29332c;
  --clay: #b85d45;
  --clay-soft: #3a241e;
  --sand: #d9b670;
  --sand-soft: #352d1d;
  --slate: #a9c1d3;
  --slate-soft: #22303a;
  --teal: #8cc7bc;
  --teal-soft: #1d332f;
  --forest-ink: #cfe6d4;
  --sage-ink: #8fc29a;
  --clay-ink: #f0a08a;
  --mint-2: #2e4637;
  --sage-soft: #213428;
  --moss-soft: #283421;
  --moss-ink: #b5d08f;
  --hover: #1f2822;
  --hover-nav: #223127;
  --track: #3a453e;
  --dash: #3a473f;
  --glass: rgba(18, 24, 19, 0.86);
  --glass-2: rgba(26, 34, 29, 0.94);
  --a5: #9db89f;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px -8px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 24px 60px -16px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --forest: #3d6650;
  --forest-2: #4a7660;
  --sage: #4f7d59;
  --moss: #7fa886;
  --mint: #24382c;
  --cream: #121813;
  --bg: #121813;
  --surface: #1a221d;
  --ink: #e6ece7;
  --ink-2: #a7b2aa;
  --ink-3: #7b877f;
  --line: #29332c;
  --clay: #b85d45;
  --clay-soft: #3a241e;
  --sand: #d9b670;
  --sand-soft: #352d1d;
  --slate: #a9c1d3;
  --slate-soft: #22303a;
  --teal: #8cc7bc;
  --teal-soft: #1d332f;
  --forest-ink: #cfe6d4;
  --sage-ink: #8fc29a;
  --clay-ink: #f0a08a;
  --mint-2: #2e4637;
  --sage-soft: #213428;
  --moss-soft: #283421;
  --moss-ink: #b5d08f;
  --hover: #1f2822;
  --hover-nav: #223127;
  --track: #3a453e;
  --dash: #3a473f;
  --glass: rgba(18, 24, 19, 0.86);
  --glass-2: rgba(26, 34, 29, 0.94);
  --a5: #9db89f;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px -8px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 24px 60px -16px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font: 400 15px/1.5 var(--sans);
  background: var(--cream);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
}
body.no-scroll { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: var(--sage-ink); text-decoration: none; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--sage); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.serif { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; }
.green { color: var(--sage-ink); }

svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- boot ---------- */
.boot { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; }
.boot img { width: 56px; height: 56px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.4; transform: scale(0.94); } }

/* ---------- layout ---------- */
.app { min-height: 100vh; min-height: 100dvh; }
.side { display: none; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + var(--safe-t)) 16px 10px;
  background: var(--glass);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
}
.topbar .sp { flex: 1; }
.topbar .search { display: none; }
.topbar .new-task { display: none; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; }
.brand img { width: 30px; height: 30px; }
.brand b { display: block; font: 500 19px/1 var(--serif); color: var(--forest-ink); letter-spacing: -0.01em; }
.brand small { display: block; margin-top: 4px; font-size: 9.5px; letter-spacing: 0.16em; color: var(--sage-ink); font-weight: 600; }
.main { padding: 8px 16px calc(96px + var(--safe-b)); max-width: 1180px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: space-around; align-items: center;
  padding: 8px 6px calc(8px + var(--safe-b));
  background: var(--glass-2);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 500; color: var(--ink-3); padding: 4px 0; position: relative; }
.tabbar a.on { color: var(--forest-ink); }
.tabbar a .n { position: absolute; top: 0; left: calc(50% + 6px); }
.tabbar .fab-wrap { flex: 1; display: flex; justify-content: center; }
.fab { width: 50px; height: 50px; border-radius: 17px; background: var(--forest); color: #fff; display: grid; place-items: center; margin-top: -24px; box-shadow: 0 10px 22px -8px rgba(46, 77, 61, 0.6); }
.fab svg.i { width: 22px; height: 22px; stroke-width: 2; }

@media (min-width: 768px) {
  .app { display: grid; grid-template-columns: 248px minmax(0, 1fr); }
  .side { display: flex; flex-direction: column; gap: 4px; padding: 24px 16px; position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; }
  .side .brand { padding: 4px 10px 26px; }
  .tabbar, .topbar .brand, .topbar .me-btn { display: none; }
  .topbar { padding: 22px 32px 10px 12px; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; position: static; }
  .topbar .search { display: flex; }
  .topbar .new-task { display: inline-flex; }
  .main { padding: 14px 32px 48px 12px; }
}

.nav a { display: flex; align-items: center; gap: 11px; padding: 10px 14px; border-radius: 999px; color: var(--ink-2); font-weight: 500; transition: background 0.15s, color 0.15s; }
.nav a:hover { background: var(--hover-nav); color: var(--forest-ink); }
.nav a.on { background: var(--forest); color: #fff; }
.nav a .n { margin-left: auto; }
.nav-sep { height: 1px; background: var(--line); margin: 14px 10px; }
.install-btn { margin-top: auto; margin-bottom: 10px; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: var(--mint); color: var(--forest-ink); text-align: left; transition: background 0.15s; }
.install-btn:hover { background: var(--mint-2); }
.install-btn b { display: block; font-weight: 600; font-size: 13.5px; }
.install-btn small { display: block; font-size: 11.5px; color: var(--sage-ink); }
.install-btn:not([hidden]) + .me { margin-top: 0; }
.side .me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px; background: var(--surface); border-radius: 18px; color: inherit; box-shadow: var(--shadow); }
.side .me b { display: block; font-size: 13px; font-weight: 500; }
.side .me small { font-size: 11.5px; color: var(--ink-3); text-transform: capitalize; }
.n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--clay); color: #fff; font-size: 11px; font-weight: 600; display: inline-grid; place-items: center; }
.nav a .n { background: var(--mint); color: var(--forest-ink); }
.nav a.on .n { background: var(--moss); }

.search { flex: 1; max-width: 420px; align-items: center; gap: 10px; background: var(--surface); border-radius: 999px; padding: 0 18px; color: var(--ink-3); box-shadow: var(--shadow); }
.search input { flex: 1; border: 0; outline: 0; background: transparent; padding: 12px 0; color: var(--ink); min-width: 0; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; padding: 12px 20px; font-weight: 500; font-size: 14px; white-space: nowrap; transition: transform 0.1s, background 0.15s, opacity 0.15s; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.sm { padding: 8px 14px; font-size: 13px; }
.btn.primary { background: var(--sage); color: #fff; }
.btn.primary:hover { filter: brightness(0.94); }
.btn.dark { background: var(--forest); color: #fff; }
.btn.ghost { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.soft { background: var(--mint); color: var(--forest-ink); }
.btn.danger { background: var(--clay); color: #fff; }
.btn.block { width: 100%; }
.round { width: 42px; height: 42px; border-radius: 50%; background: var(--surface); display: inline-grid; place-items: center; color: var(--ink); position: relative; box-shadow: var(--shadow); flex: none; }
.round.plain { box-shadow: none; background: var(--cream); width: 36px; height: 36px; }
.round.sm { width: 34px; height: 34px; }
.round.ok { background: var(--sage); color: #fff; }
.round .dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--clay); border: 2px solid var(--surface); }
.actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
.actions .btn { min-width: 110px; }
@media (max-width: 767px) { .actions .btn { flex: 1; } }

/* ---------- page head ---------- */
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 8px 0 22px; flex-wrap: wrap; }
.hero h1 { font: 400 32px/1.1 var(--serif); letter-spacing: -0.02em; }
.hero h1 em { font-style: normal; color: var(--sage-ink); }
.hero .sub { color: var(--ink-2); margin-top: 8px; font-size: 14px; }
@media (min-width: 768px) { .hero h1 { font-size: 40px; } }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 6px 0 18px; flex-wrap: wrap; }
.page-head h1 { font: 400 30px/1.15 var(--serif); letter-spacing: -0.02em; }
.page-head .sub { color: var(--ink-2); font-size: 14px; margin-top: 4px; }

.pills { display: inline-flex; gap: 4px; background: var(--surface); padding: 4px; border-radius: 999px; box-shadow: var(--shadow); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }
.pills button { padding: 8px 14px; border-radius: 999px; font-weight: 500; color: var(--ink-2); font-size: 13px; white-space: nowrap; }
.pills button.on { background: var(--mint); color: var(--forest-ink); }

/* ---------- cards & stats ---------- */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
.ch { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 20px 10px; }
.ch h2 { font: 500 20px var(--serif); letter-spacing: -0.01em; }
.ch a, .ch .link { font-size: 13px; color: var(--sage-ink); font-weight: 500; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
@media (min-width: 1024px) { .stats { grid-template-columns: repeat(4, 1fr); gap: 14px; } }
.stat { padding: 16px; display: block; color: inherit; }
.stat .k { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-weight: 500; font-size: 13px; }
.stat .k i { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--mint); color: var(--forest-ink); }
.stat .k i.warn { background: var(--clay-soft); color: var(--clay-ink); }
.stat .v { font: 400 34px/1 var(--serif); margin-top: 14px; }
.stat .v.warn { color: var(--clay-ink); }
.stat .d { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }
.stat.feature { background: var(--forest); color: #fff; }
.stat.feature .k { color: var(--moss); }
.stat.feature .k i { background: rgba(255, 255, 255, 0.12); color: #fff; }
.stat.feature .d { color: var(--moss); }
@media (min-width: 768px) { .stat { padding: 20px; } .stat .v { font-size: 40px; margin-top: 16px; } }

.grid2 { display: grid; gap: 16px; margin-bottom: 16px; }
@media (min-width: 1024px) { .grid2 { grid-template-columns: 1.35fr 1fr; } }

/* ---------- people & avatars ---------- */
.av { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 600; flex: none; letter-spacing: 0.02em; }
.av.lg { width: 44px; height: 44px; font-size: 14px; }
.a1 { background: var(--forest); color: #fff; }
.a2 { background: var(--sage); color: #fff; }
.a3 { background: var(--moss); color: #1c2620; }
.a4 { background: var(--mint); color: var(--forest-ink); }
.a5 { background: var(--a5); color: #1c2620; }
.av.more { background: var(--cream); color: var(--ink-2); }
.stack { display: inline-flex; }
.stack .av { width: 28px; height: 28px; font-size: 10.5px; border: 2px solid var(--surface); margin-left: -7px; }
.stack .av:first-child { margin-left: 0; }

.person { display: grid; grid-template-columns: 32px minmax(0, 1fr) 40px 40px; gap: 12px; align-items: center; padding: 10px 20px; color: inherit; }
.person b { font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person small { color: var(--ink-3); font-size: 12px; }
.person small.warn { color: var(--clay-ink); }
.person .bar { display: none; }
@media (min-width: 560px) { .person { grid-template-columns: 32px minmax(0, 1fr) 120px 40px 40px; } .person .bar { display: block; } }
.thead { display: none; }
@media (min-width: 560px) {
  .thead { display: grid; grid-template-columns: 32px minmax(0, 1fr) 120px 40px 40px; gap: 12px; padding: 4px 20px; font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; }
  .thead span:nth-child(n + 4) { text-align: right; }
}
.bar { height: 6px; background: var(--mint); border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--sage); border-radius: 4px; }
.num { text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.num.r { color: var(--clay-ink); }

/* ---------- tags, steps, due ---------- */
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.t-mint { background: var(--mint); color: var(--forest-ink); }
.t-slate { background: var(--slate-soft); color: var(--slate); }
.t-sage { background: var(--sage-soft); color: var(--sage-ink); }
.t-sand { background: var(--sand-soft); color: var(--sand); }
.t-teal { background: var(--teal-soft); color: var(--teal); }
.t-moss { background: var(--moss-soft); color: var(--moss-ink); }
.t-clay { background: var(--clay-soft); color: var(--clay-ink); }
.tag.urgent { background: var(--clay-soft); color: var(--clay-ink); }
.tag.status { background: var(--cream); color: var(--ink-2); }
.steps { display: flex; gap: 4px; margin-bottom: 6px; }
.steps i { width: 18px; height: 5px; border-radius: 3px; background: var(--mint); }
.steps i.f { background: var(--sage); }
.stepn { font-size: 12.5px; color: var(--ink-2); }
.due { font-weight: 500; font-variant-numeric: tabular-nums; font-size: 14px; }
.due.late { color: var(--clay-ink); }
.due.today { color: var(--sand); }
.due small { display: block; font-weight: 400; color: var(--ink-3); font-size: 12px; }

/* ---------- approvals ---------- */
.appr { margin: 0 12px 10px; padding: 12px; border-radius: 18px; background: var(--cream); display: flex; gap: 12px; align-items: center; color: inherit; }
.appr .thumb { width: 48px; height: 48px; border-radius: 14px; flex: none; background: linear-gradient(140deg, var(--sage), var(--moss)); object-fit: cover; }
.appr .t { font-weight: 500; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.appr .m { color: var(--ink-3); font-size: 12px; margin-top: 3px; }
.appr .acts { margin-left: auto; display: flex; gap: 6px; }

/* ---------- task list ---------- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500; text-align: left; padding: 8px 20px 10px; }
.tbl td { padding: 14px 20px; border-top: 1px solid var(--line); vertical-align: middle; }
.tbl tr.row { cursor: pointer; transition: background 0.12s; }
.tbl tr.row:hover td { background: var(--hover); }
.tbl .tt { font-weight: 500; }
.tbl .rq { color: var(--ink-3); font-size: 12px; margin-top: 3px; }
.only-wide { display: none; }
@media (min-width: 900px) { .only-wide { display: block; } .only-narrow { display: none; } }

.tcard { display: block; padding: 14px 16px; margin-bottom: 10px; border-radius: 22px; color: inherit; background: var(--surface); box-shadow: var(--shadow); }
.tcard .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.tcard .tt { font-weight: 500; margin-bottom: 12px; }
.tcard .steps i { flex: 1; width: auto; }
.tcard .foot { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; gap: 8px; }
.tcard .due { font-size: 12.5px; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.filters .input { width: auto; flex: 1 1 140px; min-width: 0; padding: 10px 14px; background-color: var(--surface); box-shadow: var(--shadow); }
.filters .search-in { flex: 2 1 220px; }
.chipbar { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-bottom: 14px; padding-bottom: 2px; }
.chipbar::-webkit-scrollbar { display: none; }
.chip { padding: 8px 14px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; font-weight: 500; color: var(--ink-2); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.chip.on { background: var(--forest); color: #fff; box-shadow: none; }
.chip .av { width: 22px; height: 22px; font-size: 9.5px; }
.pager { display: flex; justify-content: center; gap: 10px; margin: 18px 0; align-items: center; color: var(--ink-2); font-size: 13px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--ink-3); }
.input { width: 100%; background: var(--cream); border: 1px solid transparent; border-radius: 14px; padding: 12px 14px; outline: 0; transition: border 0.15s, background 0.15s; font-size: 16px; }
@media (min-width: 768px) { .input { font-size: 14.5px; } }
.input:focus { border-color: var(--moss); background: var(--surface); }
textarea.input { resize: vertical; min-height: 96px; line-height: 1.5; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.row2 { display: grid; gap: 0 12px; grid-template-columns: 1fr 1fr; }
.row2 > .field { min-width: 0; }
.form-error { background: var(--clay-soft); color: var(--clay-ink); padding: 10px 14px; border-radius: 14px; font-size: 13.5px; margin-bottom: 14px; }
.people-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.people-pick .chip { padding: 5px 12px 5px 5px; }
.switch { display: flex; gap: 12px; align-items: center; padding: 10px 0; cursor: pointer; }
.switch-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { width: 44px; height: 26px; border-radius: 13px; background: var(--track); position: relative; flex: none; transition: background 0.2s; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); transition: transform 0.2s; }
.switch-input:checked + .switch-track { background: var(--sage); }
.switch-input:checked + .switch-track::after { transform: translateX(18px); }
.switch-input:focus-visible + .switch-track { outline: 2px solid var(--sage); outline-offset: 2px; }
.switch-text b { display: block; font-weight: 500; font-size: 14px; }
.switch-text small { color: var(--ink-3); font-size: 12px; }

/* ---------- auth pages ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1200px 600px at 10% -10%, var(--mint), transparent 60%), var(--cream); }
.auth-card { width: 100%; max-width: 420px; padding: 30px 24px; }
@media (min-width: 480px) { .auth-card { padding: 36px 34px; } }
.auth-card .brand { margin-bottom: 30px; }
.auth-card h1 { font: 400 34px/1.1 var(--serif); letter-spacing: -0.02em; margin-bottom: 8px; }
.auth-card h1 em { font-style: normal; color: var(--sage-ink); }
.auth-card p.muted { margin-bottom: 24px; font-size: 14px; }
.auth-card .btn { width: 100%; margin-top: 6px; padding: 14px; }

/* ---------- task page ---------- */
.dh { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 16px; }
.dh h1 { font: 400 28px/1.15 var(--serif); letter-spacing: -0.015em; word-break: break-word; }
@media (min-width: 768px) { .dh h1 { font-size: 34px; } }
.dh .meta { color: var(--ink-2); font-size: 13.5px; margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.task-layout { display: grid; gap: 16px; }
@media (min-width: 1024px) { .task-layout { grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); align-items: start; } }
.infocard { padding: 16px; }
.infocard .ok { display: flex; align-items: center; gap: 10px; font-weight: 500; color: var(--forest-ink); }
.infocard .ok.warn { color: var(--clay-ink); }
.infocard .ok i { width: 28px; height: 28px; border-radius: 50%; background: var(--sage); color: #fff; display: grid; place-items: center; }
.infocard .ok.warn i { background: var(--clay); }
.infocard .ok i svg.i { width: 15px; height: 15px; stroke-width: 2.2; }
.kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 14px; background: var(--cream); border-radius: 16px; padding: 12px 6px; }
.kv div { text-align: center; font-size: 11.5px; color: var(--ink-3); padding: 0 4px; min-width: 0; }
.kv b { display: block; color: var(--ink); font-size: 13.5px; font-weight: 500; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.desc { white-space: pre-wrap; color: var(--ink); line-height: 1.6; margin-top: 14px; font-size: 14.5px; }
.tabs { display: flex; gap: 6px; margin: 4px 0 14px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.tabs button.on { background: var(--mint); color: var(--forest-ink); }
.tabs button .c { margin-left: 4px; color: var(--ink-3); font-weight: 400; }
.tl { display: grid; grid-template-columns: 30px minmax(0, 1fr); column-gap: 12px; }
.tl .rail { display: flex; flex-direction: column; align-items: center; }
.tl .dotn { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; background: var(--mint); color: var(--forest-ink); flex: none; }
.tl .dotn.done { background: var(--sage); color: #fff; }
.tl .dotn.now { background: var(--forest); color: #fff; box-shadow: 0 0 0 4px var(--mint); }
.tl .dotn svg.i { width: 14px; height: 14px; stroke-width: 2.4; }
.tl .ln { flex: 1; width: 0; border-left: 1.5px dashed var(--moss); margin: 4px 0; min-height: 10px; }
.tl .st { background: var(--surface); border-radius: 18px; padding: 11px 14px; margin-bottom: 10px; box-shadow: var(--shadow); }
.tl .st b { font-weight: 500; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tl .st small { color: var(--ink-3); font-size: 12px; display: block; margin-top: 3px; }
.tl .st.muted { background: transparent; box-shadow: none; border: 1px dashed var(--dash); }
.tl .st.muted b { color: var(--ink-2); }
.cta { position: sticky; bottom: calc(76px + var(--safe-b)); z-index: 10; display: flex; gap: 10px; padding: 12px 0 4px; background: linear-gradient(transparent, var(--cream) 30%); }
.cta .btn { flex: 1; padding: 14px; }
@media (min-width: 768px) { .cta { position: static; background: none; padding: 6px 0 0; } }
.comment { display: flex; gap: 10px; margin-bottom: 14px; }
.comment .bubble { background: var(--surface); border-radius: 4px 18px 18px 18px; padding: 10px 14px; box-shadow: var(--shadow); min-width: 0; flex: 1; }
.comment .bubble b { font-weight: 500; font-size: 13px; }
.comment .bubble small { color: var(--ink-3); font-size: 11.5px; margin-left: 6px; }
.comment .bubble p { white-space: pre-wrap; margin-top: 3px; word-break: break-word; }
.composer { display: flex; gap: 8px; align-items: flex-end; margin-top: 8px; }
.composer textarea { min-height: 46px; height: 46px; border-radius: 22px; padding: 12px 16px; }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.file { position: relative; border-radius: 16px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); color: inherit; }
.file img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--mint); }
.file .cap { padding: 8px 10px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file .del { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; }
.linkrow { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); margin-bottom: 8px; color: inherit; }
.linkrow .ic { width: 36px; height: 36px; border-radius: 12px; background: var(--mint); color: var(--forest-ink); display: grid; place-items: center; flex: none; }
.linkrow .tx { min-width: 0; flex: 1; }
.linkrow .tx b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linkrow .tx small { color: var(--ink-3); font-size: 12px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist { list-style: none; }
.hist li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.hist li:last-child { border-bottom: 0; }
.hist li small { color: var(--ink-3); margin-left: auto; white-space: nowrap; padding-left: 8px; }
.viewer { max-height: 75vh; width: 100%; object-fit: contain; border-radius: 16px; }

/* ---------- list rows ---------- */
.lrow { display: flex; gap: 12px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line); color: inherit; }
.lrow:first-child { border-top: 0; }
.lrow .tx { flex: 1; min-width: 0; }
.lrow .tx b { font-weight: 500; display: block; }
.lrow .tx small { color: var(--ink-3); font-size: 12.5px; }
.lrow.unread { background: var(--hover); }
.lrow.unread .tx b::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--sage); margin-right: 8px; vertical-align: 1px; }
.lrow .ic { width: 38px; height: 38px; border-radius: 50%; background: var(--mint); color: var(--forest-ink); display: grid; place-items: center; flex: none; }
.lrow .ic.warn { background: var(--clay-soft); color: var(--clay-ink); }

/* ---------- daily / report ---------- */
.rcard { padding: 16px 18px; margin-bottom: 12px; }
.rcard .top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.rcard .top b { font-weight: 500; }
.rcard .note { white-space: pre-wrap; line-height: 1.6; }
.rcard .missing { color: var(--clay-ink); font-weight: 500; font-size: 13.5px; }
.rcard .touched { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.rcard .touched a { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--cream); color: var(--ink-2); }
.summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
@media (min-width: 768px) { .summary { grid-template-columns: repeat(4, 1fr); } }
.section-title { font: 500 20px var(--serif); margin: 22px 0 10px; }

/* ---------- settings ---------- */
.set-block { padding: 18px 20px; margin-bottom: 16px; }
.set-block h2 { font: 500 20px var(--serif); margin-bottom: 4px; }
.set-block > p { color: var(--ink-2); font-size: 13.5px; margin-bottom: 14px; }
.stage-row { display: flex; gap: 6px; align-items: center; padding: 6px 0; }
.stage-row .input { flex: 1; padding: 9px 12px; }
.stage-row .round { width: 34px; height: 34px; box-shadow: none; background: var(--cream); }
.wt { border-top: 1px solid var(--line); padding: 14px 0; }
.wt:first-of-type { border-top: 0; }
.wt-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; cursor: pointer; }
.wt-head b { font-weight: 500; }

/* ---------- empty, loading ---------- */
.empty { text-align: center; padding: 36px 20px; color: var(--ink-2); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty b { font: 500 19px var(--serif); color: var(--ink); }
.empty p { font-size: 13.5px; max-width: 320px; }
.empty .btn { margin-top: 8px; }
.empty-ic { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--mint); color: var(--forest-ink); margin-bottom: 4px; }
.empty-ic.warn { background: var(--clay-soft); color: var(--clay-ink); }
.loading { display: flex; gap: 6px; justify-content: center; padding: 48px 0; }
.loading span { width: 8px; height: 8px; border-radius: 50%; background: var(--moss); animation: bounce 1s infinite ease-in-out; }
.loading span:nth-child(2) { animation-delay: 0.15s; }
.loading span:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; } 40% { transform: scale(1); opacity: 1; } }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(28, 38, 32, 0.32); display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity 0.2s; }
.overlay.show { opacity: 1; }
.sheet { background: var(--surface); width: 100%; max-height: 92vh; max-height: 92dvh; display: flex; flex-direction: column; border-radius: 28px 28px 0 0; transform: translateY(30px); transition: transform 0.22s ease; padding-bottom: var(--safe-b); }
.overlay.show .sheet { transform: none; }
.sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 8px auto 0; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px 8px; }
.sheet-head h2 { font: 500 22px var(--serif); letter-spacing: -0.01em; }
.sheet-body { padding: 6px 20px 20px; overflow-y: auto; overscroll-behavior: contain; }
@media (min-width: 768px) {
  .overlay { align-items: center; padding: 24px; }
  .sheet { max-width: 520px; border-radius: 28px; box-shadow: var(--shadow-lg); }
  .sheet.wide { max-width: 760px; }
  .sheet-grip { display: none; }
  .sheet-head { padding: 22px 26px 8px; }
  .sheet-body { padding: 6px 26px 26px; }
}
.toast { position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); z-index: 200; transform: translate(-50%, 20px); opacity: 0; transition: all 0.25s; background: var(--forest); color: #fff; padding: 12px 18px; border-radius: 999px; display: flex; gap: 10px; align-items: center; box-shadow: var(--shadow-lg); font-size: 14px; max-width: calc(100vw - 32px); }
.toast.error { background: var(--clay); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 768px) { .toast { bottom: 32px; } }

.popover { position: absolute; right: 0; top: 52px; width: 380px; max-height: 70vh; overflow-y: auto; z-index: 50; padding: 6px 0; }
.bell-wrap { position: relative; }

.banner { display: flex; gap: 12px; align-items: center; padding: 14px 16px; margin-bottom: 16px; border-radius: 20px; background: var(--mint); color: var(--forest-ink); }
.banner .tx { flex: 1; font-size: 13.5px; }
.banner .tx b { display: block; font-weight: 600; }

.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 8px 0 18px; }
.quick a, .quick button { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-2); }
.quick span.q { width: 54px; height: 54px; border-radius: 18px; background: var(--surface); display: grid; place-items: center; color: var(--forest-ink); box-shadow: var(--shadow); }
.sec-h { display: flex; justify-content: space-between; align-items: baseline; margin: 6px 0 12px; }
.sec-h h3 { font: 500 20px var(--serif); }
.sec-h a { font-size: 13px; color: var(--ink-2); }

.menu-list { padding: 6px 0; margin-bottom: 16px; }
.menu-list a, .menu-list button { display: flex; align-items: center; gap: 14px; padding: 14px 20px; width: 100%; text-align: left; color: var(--ink); font-weight: 500; border-top: 1px solid var(--line); }
.menu-list > :first-child { border-top: 0; }
.menu-list .ic { width: 36px; height: 36px; border-radius: 12px; background: var(--mint); color: var(--forest-ink); display: grid; place-items: center; }
.menu-list .tx { flex: 1; }
.menu-list small { display: block; color: var(--ink-3); font-weight: 400; font-size: 12px; }

/* ---------- print (staff report) ---------- */
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; font-size: 11pt; }
  .side, .topbar, .tabbar, .no-print, .toast { display: none !important; }
  .app { display: block; }
  .main { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  .stat.feature { background: #fff; color: var(--ink); }
  .stat.feature .k, .stat.feature .d { color: var(--ink-2); }
  .print-only { display: block !important; }
}
.print-only { display: none; }
