/* Web-only styling: the sign-in page and the little account button. The app's own look comes from
   src/renderer/styles.css, served unchanged. */

/* ---------- sign-in ---------- */
.auth-page {
  --bg: #e6e6e8; --panel: #ffffff; --ink: #17243b; --muted: #64748b; --line: #dde4ee; --accent: #095bdc; --danger: #e11d48;
  margin: 0; min-height: 100vh; display: grid; place-items: center; padding: 24px; box-sizing: border-box;
  background: var(--bg); color: var(--ink); font: 14px/1.45 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, sans-serif;
  overflow: auto;
}
@media (prefers-color-scheme: dark) {
  .auth-page { --bg: #070a0f; --panel: #14181f; --ink: #e9eaed; --muted: #a3a6af; --line: #2b3039; --accent: #4b9bff; --danger: #ef9aa6; }
  .auth-logo { background: #fff; border-radius: 10px; padding: 4px 8px; }
}
.auth-card { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 28px 28px 24px; box-sizing: border-box; }
.auth-logo { display: block; height: 44px; max-width: 100%; margin: 0 auto 8px; }
.auth-tagline { text-align: center; color: var(--muted); font-size: 12.5px; margin: 0 0 20px; }
.auth-card h1 { font-size: 22px; margin: 0 0 14px; letter-spacing: -.01em; }
.auth-card form { display: grid; gap: 12px; }
.auth-card label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.auth-card input { font: inherit; font-size: 14px; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.auth-card input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.auth-card button[type='submit'] { font: inherit; font-weight: 650; color: #fff; background: var(--accent); border: 0; border-radius: 10px; padding: 11px; cursor: pointer; margin-top: 4px; }
.auth-card button[type='submit']:disabled { opacity: .6; cursor: default; }
.auth-hint { margin: -4px 0 0; font-size: 12px; color: var(--muted); }
.auth-error { margin: 0; font-size: 13px; color: var(--danger); }
.auth-switch { margin: 16px 0 0; text-align: center; color: var(--muted); font-size: 13px; }
.auth-switch a { color: var(--accent); font-weight: 600; text-decoration: none; }
.auth-card [hidden] { display: none; }

/* ---------- account button (inside the app) ---------- */
#web-account { position: fixed; right: 14px; bottom: 14px; z-index: 30; }
.web-avatar { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line, #dde4ee); background: var(--panel, #fff); color: var(--ink, #17243b); font: 600 12px/1 'Segoe UI', system-ui, sans-serif; cursor: pointer; box-shadow: 0 1px 4px rgba(0, 0, 0, .15); opacity: .75; }
.web-avatar:hover, .web-avatar[aria-expanded='true'] { opacity: 1; }
.web-account-menu { position: absolute; right: 0; bottom: 38px; min-width: 200px; background: var(--panel, #fff); color: var(--ink, #17243b); border: 1px solid var(--line, #dde4ee); border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); padding: 6px; }
.web-account-menu[hidden] { display: none; }
.web-account-menu .who { display: grid; padding: 8px 10px; gap: 2px; font-size: 13px; }
.web-account-menu .who span { color: var(--muted, #64748b); font-size: 12px; overflow-wrap: anywhere; }
.web-account-menu .signout { width: 100%; text-align: left; font: inherit; font-size: 13px; color: inherit; background: none; border: 0; border-top: 1px solid var(--line, #dde4ee); padding: 9px 10px; cursor: pointer; border-radius: 0 0 8px 8px; }
.web-account-menu .signout:hover { background: var(--accent-soft, #e9efff); }

/* ---------- account and admin pages ---------- */
.page-wide { align-items: start; }
.auth-card.wide { max-width: 760px; }
.auth-card h2 { font-size: 15px; margin: 22px 0 8px; }
.auth-card .danger-title { color: var(--danger); }
.auth-tagline.left { text-align: left; margin-bottom: 14px; }
.page-back { margin: 0 0 10px; font-size: 13px; }
.page-back a { color: var(--accent); text-decoration: none; font-weight: 600; }
.auth-card .stack { display: grid; gap: 12px; }
.auth-card button { font: inherit; font-size: 13px; font-weight: 600; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 9px; padding: 7px 12px; cursor: pointer; }
.auth-card button:hover { border-color: var(--accent); }
.auth-card button.danger { color: var(--danger); }
.auth-card .stack button[type='submit'], .auth-card .inline button[type='submit'] { color: #fff; background: var(--accent); border: 0; }
.auth-card .stack button.danger[type='submit'] { background: var(--danger); color: #fff; }
.auth-card .inline { display: flex; gap: 8px; }
.auth-card .inline input { flex: 1; min-width: 0; }
.link-box { display: grid; gap: 6px; margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; font-size: 12.5px; color: var(--muted); }
.link-box input { font-size: 12px; }
.user-list { margin-top: 8px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.row .who { display: grid; gap: 2px; min-width: 0; }
.row .who span { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.row .who b { color: var(--ink); font-size: 14px; }
.row .who .badge { color: var(--accent); font-weight: 600; margin-left: 6px; }
.row .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.web-account-menu .menu-link { display: block; font-size: 13px; color: inherit; text-decoration: none; padding: 9px 10px; border-top: 1px solid var(--line, #dde4ee); }
.web-account-menu .menu-link:hover { background: var(--accent-soft, #e9efff); }

.web-account-menu .menu-btn { width: 100%; text-align: left; font: inherit; font-size: 13px; color: inherit; background: none; border: 0; border-top: 1px solid var(--line, #dde4ee); padding: 9px 10px; cursor: pointer; }
.web-account-menu .menu-btn:hover:not(:disabled) { background: var(--accent-soft, #e9efff); }
.web-account-menu .menu-btn[hidden] { display: none; }

/* ---------- phones ---------- */
.web-topbar, .web-nav-backdrop { display: none; }
@media (max-width: 720px) {
  html, body { overscroll-behavior: none; }
  input, select, textarea { font-size: 16px; } /* iOS zooms into smaller fields */
  .web-topbar { display: flex; position: fixed; top: 0; left: 0; right: 0; z-index: 40; align-items: center; gap: 8px; box-sizing: border-box; height: calc(52px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 56px 0 8px; background: var(--panel, #fff); color: var(--ink, #17243b); border-bottom: 1px solid var(--line, #dde4ee); }
  .web-topbar-title { font-size: 15px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .web-menu-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; border: 0; border-radius: 12px; background: transparent; color: inherit; cursor: pointer; }
  .web-menu-btn:active { background: var(--accent-soft, #e9efff); }
  .app { box-sizing: border-box; height: 100vh; height: 100dvh; padding-top: calc(52px + env(safe-area-inset-top)); }
  .sidebar { display: flex !important; flex-direction: column; position: fixed; z-index: 50; top: 0; bottom: 0; left: 0; width: min(86vw, 320px); box-sizing: border-box; overflow-y: auto; overscroll-behavior: contain; padding-top: calc(20px + env(safe-area-inset-top)); transform: translateX(-104%); transition: transform .22s ease; box-shadow: none; }
  body.web-nav-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .35); }
  .web-nav-backdrop { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(8, 12, 20, .45); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  body.web-nav-open .web-nav-backdrop { opacity: 1; pointer-events: auto; }
  body.web-nav-open { overflow: hidden; }
  #web-account { z-index: 42; top: calc(6px + env(safe-area-inset-top)); bottom: auto; right: 10px; }
  .web-avatar { width: 40px; height: 40px; font-size: 14px; opacity: 1; }
  .web-account-menu { top: 46px; bottom: auto; }
  .toast { max-width: calc(100vw - 32px); bottom: calc(18px + env(safe-area-inset-bottom)); }
  @media (prefers-reduced-motion: reduce) { .sidebar, .web-nav-backdrop { transition: none; } }
}

/* One column on narrow screens: with nothing selected, show just the list (the empty "Select something" panel would stack under it). */
@media (max-width: 1000px) {
  .main:not(.has-detail) .detail-pane { display: none; }
  .main { min-height: 0; }
}
