:root {
  --font-main: "Google Sans Flex", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #f6f5f2; --surface: #ffffff; --text: #171717; --muted: #67645e; --border: #e1dfd8;
  --accent: #171717; --danger: #9c1c1c; --ok: #0c6b43; --warning: #8a5b00;
  --radius: 22px; --shadow: 0 18px 50px rgba(0,0,0,.07);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font-main); background: var(--bg); color: var(--text); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; padding-bottom: 88px; }
.topbar { position: sticky; top: 0; z-index: 20; display:flex; justify-content:space-between; align-items:center; gap:12px; padding:16px; background:rgba(246,245,242,.9); backdrop-filter:blur(16px); border-bottom:1px solid var(--border); }
.brand h1 { margin:0; font-size:1.05rem; line-height:1.1; }
.eyebrow { margin:0 0 4px; color:var(--muted); font-size:.72rem; letter-spacing:.08em; text-transform:uppercase; font-weight:750; }
.main { width:min(1180px,100%); margin:0 auto; padding:16px; display:grid; gap:16px; }
.card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow); padding:18px; }
.hero { min-height:160px; display:flex; align-items:end; }
h2 { margin:0 0 8px; font-size:clamp(1.3rem,4.5vw,2.2rem); line-height:1.05; }
p { color:var(--muted); }
.grid { display:grid; gap:14px; }
.metric strong { font-size:2rem; display:block; }
.metric span { color:var(--muted); }
.login-wrap { min-height:100vh; display:grid; place-items:center; padding:20px; }
.login-card { width:min(420px,100%); }
.form { display:grid; gap:14px; }
.field { display:grid; gap:6px; }
.field label { font-size:.9rem; font-weight:650; }
.field input, .field textarea, .field select { width:100%; border:1px solid var(--border); border-radius:14px; padding:12px 13px; background:#fff; color:var(--text); }
.field textarea { min-height:110px; resize:vertical; }
.actions { display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.btn { border:0; border-radius:999px; background:var(--accent); color:#fff; padding:11px 15px; display:inline-flex; align-items:center; gap:8px; font-weight:720; }
.btn.secondary { background:#ebe9e2; color:var(--text); }
.btn.danger { background:var(--danger); }
.btn.icon { padding:10px; }
.error { color:var(--danger); font-size:.92rem; }
.success { color:var(--ok); font-size:.92rem; }
.muted { color:var(--muted); }
.toolbar { display:flex; flex-wrap:wrap; gap:10px; justify-content:space-between; align-items:center; }
.entity-tabs { display:flex; gap:8px; overflow:auto; padding:4px 0; }
.entity-tabs button { border:1px solid var(--border); background:#fff; border-radius:999px; padding:9px 12px; white-space:nowrap; display:flex; align-items:center; gap:6px; }
.entity-tabs button.active { background:#171717; color:white; border-color:#171717; }
.list { display:grid; gap:10px; }
.entity-card { border:1px solid var(--border); border-radius:18px; padding:14px; background:#fff; display:grid; gap:8px; }
.entity-card h3 { margin:0; }
.badges { display:flex; flex-wrap:wrap; gap:6px; }
.badge { display:inline-flex; align-items:center; border-radius:999px; padding:4px 8px; font-size:.78rem; background:#f1efe9; color:#3d3a34; }
.badge.high,.badge.urgent { background:#ffe7d6; color:#6d2c00; }
.badge.archived { background:#eee; color:#777; }
.drawer-backdrop { position:fixed; inset:0; background:rgba(0,0,0,.28); z-index:40; display:none; }
.drawer-backdrop.show { display:block; }
.drawer { position:fixed; right:0; top:0; bottom:0; width:min(620px,100%); background:#fff; z-index:50; transform:translateX(105%); transition:.22s ease; padding:18px; overflow:auto; box-shadow:-20px 0 60px rgba(0,0,0,.18); }
.drawer.show { transform:translateX(0); }
.drawer-head { display:flex; justify-content:space-between; align-items:start; gap:12px; margin-bottom:18px; }
.bottom-nav { position:fixed; left:12px; right:12px; bottom:12px; z-index:30; display:grid; grid-template-columns:repeat(4,1fr); gap:8px; padding:8px; border-radius:22px; background:rgba(255,255,255,.92); border:1px solid var(--border); box-shadow:var(--shadow); backdrop-filter:blur(16px); }
.bottom-nav button { border:0; background:transparent; display:grid; gap:2px; justify-items:center; color:var(--text); padding:8px 4px; border-radius:14px; }
.bottom-nav button.active { background:#f1efe9; }
.material-icons { font-size:21px; }
.skeleton { min-height:80px; border-radius:18px; background:linear-gradient(90deg,#eee,#f8f8f8,#eee); animation:pulse 1.2s infinite; }
@keyframes pulse { 0%{opacity:.65} 50%{opacity:1} 100%{opacity:.65} }
@media (min-width:760px) { .app-shell{padding-bottom:0}.main{padding:24px}.grid{grid-template-columns:repeat(4,1fr)}.layout{display:grid; grid-template-columns:260px 1fr; gap:16px}.bottom-nav{left:50%; right:auto; transform:translateX(-50%); width:min(560px,calc(100% - 24px));} }


.app-fallback {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}
.app-fallback a {
  color: var(--text);
  font-weight: 700;
}
