/* Общие стили страниц входа и списка досок */
:root {
  --bg: #f2f3f5; --panel: #fff; --line: #e8e9ec; --text: #1f2329; --muted: #6b7280;
  --accent: #4262ff; --accent-dark: #2f4be0; --accent-soft: #eef1ff; --danger: #e5484d;
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 8px 24px rgba(16, 24, 40, .10);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); -webkit-font-smoothing: antialiased; }
button, input, select { font-family: inherit; font-size: 14px; }
.hidden { display: none !important; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.logo { width: 34px; height: 34px; border-radius: 9px; color: #fff; font-weight: 800; font-size: 18px; display: grid; place-items: center; background: linear-gradient(135deg, #4262ff, #8b5cf6); flex: none; }

.btn {
  height: 40px; padding: 0 16px; border: 1px solid #dfe1e6; border-radius: 10px; background: #fff; color: var(--text);
  font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
}
.btn:hover { background: #f6f7f9; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.danger { color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: #eef0f3; }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: default; }
.input {
  width: 100%; height: 42px; padding: 0 12px; border: 1px solid #dfe1e6; border-radius: 10px; background: #fff; outline: none;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: #3d4350; }
.error { color: var(--danger); font-size: 13.5px; min-height: 18px; margin: 4px 0 10px; }
.hint { color: var(--muted); font-size: 13px; line-height: 1.45; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px;
  flex: none; overflow: hidden; background: #8a9099;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.lg { width: 72px; height: 72px; font-size: 28px; }

/* ================= Вход ================= */
body.login { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.auth-card { width: min(420px, 100%); background: #fff; border-radius: 18px; box-shadow: var(--shadow); padding: 32px 32px 26px; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-brand b { font-size: 22px; }
.tabs { display: flex; background: #f2f3f5; border-radius: 10px; padding: 4px; margin-bottom: 20px; }
.tabs button { flex: 1; height: 34px; border: 0; border-radius: 8px; background: transparent; font-weight: 600; color: var(--muted); cursor: pointer; }
.tabs button.on { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.auth-card .btn.primary { width: 100%; height: 44px; font-size: 15px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 18px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.oauth { display: flex; flex-direction: column; gap: 10px; }
.oauth .btn { width: 100%; height: 44px; }
.oauth .mark { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 12px; }
.mark.g { background: conic-gradient(#ea4335 0 25%, #fbbc05 0 50%, #34a853 0 75%, #4285f4 0); }
.mark.tg { background: #2aabee; }

/* ================= Список досок ================= */
body.dash { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.side { background: #fff; border-right: 1px solid var(--line); padding: 16px 12px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 12px; font-weight: 800; font-size: 18px; }
.team-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 0; background: transparent; border-radius: 10px; cursor: pointer; text-align: left; }
.team-btn:hover { background: #f2f3f5; }
.team-mark { width: 30px; height: 30px; border-radius: 8px; background: #1f2329; color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.team-btn .tname { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.nav button { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; font-weight: 500; color: #2b2f36; text-align: left; }
.nav button:hover { background: #f2f3f5; }
.nav button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side .spacer { flex: 1; }
.main { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 14px 28px; background: var(--bg); position: sticky; top: 0; z-index: 5; }
.search { flex: 1; max-width: 520px; position: relative; }
.search .ic { position: absolute; left: 12px; top: 11px; color: var(--muted); }
.search .input { padding-left: 40px; background: #fff; }
.topbar .grow { flex: 1; }
.me-btn { border: 0; background: transparent; cursor: pointer; padding: 2px; border-radius: 50%; }
.content { padding: 8px 28px 40px; }
.content-head { display: flex; align-items: center; gap: 12px; margin: 10px 0 18px; }
.content-head h1 { font-size: 24px; margin: 0; flex: 1; }
.board-list { background: #fff; border-radius: 14px; box-shadow: 0 1px 2px rgba(16, 24, 40, .06); overflow: hidden; }
.brow, .bhead { display: grid; grid-template-columns: minmax(0, 1fr) 180px 150px 40px 40px; align-items: center; gap: 12px; padding: 0 16px; }
.bhead { height: 40px; font-size: 12.5px; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); }
.brow { height: 58px; border-bottom: 1px solid #f1f2f4; cursor: pointer; }
.brow:last-child { border-bottom: 0; }
.brow:hover { background: #f8f9fb; }
.bname { display: flex; align-items: center; gap: 12px; min-width: 0; }
.bicon { width: 36px; height: 36px; border-radius: 9px; background: #eef1ff; display: grid; place-items: center; font-size: 18px; flex: none; }
.btitle { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bsub { font-size: 12.5px; color: var(--muted); }
.bowner { display: flex; align-items: center; gap: 8px; font-size: 13.5px; min-width: 0; }
.bowner span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bowner .avatar { width: 24px; height: 24px; font-size: 11px; }
.bdate { font-size: 13.5px; color: var(--muted); }
.icon-btn { width: 34px; height: 34px; border: 0; background: transparent; border-radius: 8px; display: grid; place-items: center; cursor: pointer; color: #6b7280; }
.icon-btn:hover { background: #eef0f3; color: var(--text); }
.icon-btn.star.on { color: #e8a200; }
.icon-btn.star.on .ic { fill: #fac710; stroke: #e8a200; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.brow.trash { grid-template-columns: minmax(0, 1fr) auto; cursor: default; }
.trash-note { padding: 12px 16px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); background: #fafbfc; }
.banner { background: #fff4e5; color: #8a4b00; border: 1px solid #ffd7a3; border-radius: 12px; padding: 12px 16px; margin: 10px 0; font-size: 14px; line-height: 1.45; }
.server-info { font-size: 12px; color: var(--muted); line-height: 1.45; padding: 8px 10px; border-radius: 8px; background: #f6f7f9; margin: 0 0 6px; }
.status { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 10px; margin-left: 8px; }
.status.progress { background: #fff4d6; color: #9a6b00; }
.status.review { background: #e9f2fe; color: #2459c7; }
.status.done { background: #e4f6ea; color: #17804a; }

/* меню и модальные окна */
.menu { position: fixed; z-index: 50; background: #fff; border-radius: 12px; box-shadow: var(--shadow); padding: 6px; min-width: 220px; }
.menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 10px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; text-align: left; color: #2b2f36; font-weight: 500; }
.menu button:hover { background: #f2f3f5; }
.menu button.danger { color: var(--danger); }
.menu .sep { height: 1px; background: var(--line); margin: 4px 2px; }
.menu .label { font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px 10px 4px; }
.modal-back { position: fixed; inset: 0; background: rgba(16, 20, 30, .32); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal { background: #fff; border-radius: 16px; box-shadow: var(--shadow); padding: 22px 24px; width: min(480px, 100%); max-height: calc(100vh - 32px); overflow: auto; }
.modal h2 { margin: 0 0 16px; font-size: 19px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.row { display: flex; align-items: center; gap: 10px; }
.colors { display: flex; gap: 8px; flex-wrap: wrap; }
.colors button { width: 28px; height: 28px; border-radius: 50%; border: 0; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.colors button.on { outline: 2px solid var(--accent); outline-offset: 2px; }
.people { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.person { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.person .pname { flex: 1; min-width: 0; }
.person .pname b { display: block; font-weight: 600; }
.person .pname span { font-size: 12.5px; color: var(--muted); }
select.input { height: 36px; width: auto; padding: 0 8px; }
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px); background: #1f2329; color: #fff; padding: 10px 16px;
  border-radius: 10px; font-size: 14px; font-weight: 500; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; z-index: 120;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 800px) {
  body.dash { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .brow, .bhead { grid-template-columns: minmax(0, 1fr) 40px 40px; }
  .bowner, .bdate, .bhead .c-owner, .bhead .c-date { display: none; }
}

/* ================= Политика и условия ================= */
.auth-legal { margin: 18px 0 0; text-align: center; font-size: 12.5px; }
.auth-legal a, .legal-card a { color: var(--accent); text-decoration: none; }
.auth-legal a:hover, .legal-card a:hover { text-decoration: underline; }
body.legal { padding: 32px 16px; }
.legal-card { max-width: 760px; margin: 0 auto; background: #fff; border-radius: 18px; box-shadow: var(--shadow); padding: 32px 36px; line-height: 1.6; font-size: 15px; }
.legal-card .auth-brand { color: inherit; }
.legal-card .auth-brand:hover { text-decoration: none; }
.legal-card h1 { font-size: 26px; margin: 0 0 4px; }
.legal-card h2 { font-size: 17px; margin: 24px 0 6px; }
.legal-card ul { padding-left: 20px; }
@media (max-width: 600px) { .legal-card { padding: 24px 20px; } }
