/* Shared design tokens and components for the dashboard, login and admin pages. */
:root {
  --bg: #f6f7f9;
  --surface: #fff;
  --text: #111827;
  --muted: #5b6472;
  --line: #e2e5ea;
  --accent: #2563eb;
  --accent-text: #fff;
  --radius: 12px;
  --shadow: 0 1px 2px rgb(0 0 0 / 6%), 0 8px 24px rgb(0 0 0 / 8%);
  font: 16px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0e1116; --surface: #171b22; --text: #e8ebf0; --muted: #98a2b3; --line: #2a303a; --accent: #6ea0ff; --accent-text: #0b1220; --shadow: 0 8px 24px rgb(0 0 0 / 50%); }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--text); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.center { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 24px; text-align: center; }
.muted { color: var(--muted); }

/* Header */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; }
.brand img { width: 32px; height: 32px; }
.search { flex: 1; max-width: 520px; margin: 0 auto; }
.search input { width: 100%; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); font: inherit; }
.avatar { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg) center/cover; cursor: pointer; padding: 0; color: var(--text); font-weight: 700; }
.menu { position: absolute; right: 24px; top: 58px; min-width: 260px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); display: grid; gap: 8px; }
.menu[hidden] { display: none; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); font-size: 12px; color: var(--muted); }

/* App grid */
main.wrap { max-width: 1120px; margin: 0 auto; padding: 24px; }
h1 { font-size: 1.6rem; margin: 0 0 4px; }
h2 { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 32px 0 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.app { display: flex; gap: 12px; align-items: center; min-height: 72px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; }
a.app:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.app img { width: 44px; height: 44px; flex: none; }
.app b { display: block; }
.app small { display: block; color: var(--muted); line-height: 1.3; }
.app.locked { opacity: .55; cursor: not-allowed; }
.empty { padding: 32px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }
@media (max-width: 640px) {
  .top { padding: 8px 12px; gap: 8px; }
  .brand span { display: none; }
  main.wrap { padding: 16px 12px; }
  .menu { right: 12px; }
}
@media (prefers-reduced-motion: no-preference) { .app, .btn { transition: border-color .15s, box-shadow .15s; } }
