/* The shell of the site, the first screen, and the dialogs of the shell. The boards add their own part below. */

/* ---- Brand ---- */

.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 16px; letter-spacing: -.01em; }
.mark { position: relative; width: 22px; height: 22px; border-radius: 7px; background: var(--raised); flex: none; }
.mark::after { content: ""; position: absolute; inset: 0; margin: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }

/* ---- Shell: a sidebar and the board on a computer ---- */

.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); height: 100dvh; padding: 8px; gap: 8px; }

.sidebar { display: flex; flex-direction: column; gap: 20px; min-height: 0; padding: 14px 10px 10px; background: var(--surface); border-radius: var(--r-lg); }
.sidebar .brand { padding: 4px 8px; }

.nav { display: grid; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: var(--r-md);
  color: var(--text-2); font-weight: 500; transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.nav-item svg { width: 17px; height: 17px; flex: none; }
.nav-item:hover { background: var(--raised); color: var(--text); }
.nav-item.is-active { background: var(--selected); color: var(--on-selected); }
.nav-item .badge { margin-left: auto; }

.side-foot { margin-top: auto; }
.account-chip { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border-radius: var(--r-md); text-align: left; color: var(--text-3); }
.account-chip:hover { background: var(--raised); }
.account-chip svg { width: 14px; height: 14px; flex: none; }
.account-text { display: grid; min-width: 0; flex: 1; line-height: 1.25; }
.account-name { color: var(--text); font-weight: 550; font-size: 13px; }
.account-project { font-size: 11px; color: var(--text-3); }

.main { display: grid; grid-template-rows: auto minmax(0, 1fr); min-width: 0; min-height: 0; overflow: hidden; background: var(--surface); border-radius: var(--r-lg); }
.topbar { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 14px 20px 6px; }
.page-title { flex: 1; min-width: 0; font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.avatar-btn { display: none; }
.content { position: relative; min-height: 0; overflow: auto; padding: 8px 20px 20px; }

.tabbar { display: none; }

/* ---- Shell on a phone: the boards are tabs along the bottom ---- */

@media (max-width: 899px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; padding: 0; gap: 0; background: var(--surface); }
  .sidebar { display: none; }
  .main { border-radius: 0; }
  .topbar { min-height: 52px; padding: calc(8px + env(safe-area-inset-top)) 16px 4px; }
  .page-title { font-size: 22px; }
  .avatar-btn { display: grid; }
  .content { padding: 8px 16px 16px; }

  .tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: var(--surface); border-top: 1px solid var(--line-soft);
  }
  .tab { display: grid; justify-items: center; gap: 3px; padding: 4px 0; color: var(--text-3); font-size: 10px; font-weight: 500; -webkit-tap-highlight-color: transparent; }
  .tab svg { width: 22px; height: 22px; }
  .tab.is-active { color: var(--text); }
  .tab-icon { position: relative; display: grid; }
  .tab .badge { position: absolute; top: -5px; right: -12px; min-width: 16px; height: 16px; font-size: 10px; }
}

/* ---- First screen ---- */

.auth { display: grid; grid-template-rows: auto 1fr; min-height: 100dvh; padding: 16px 20px; }
.auth-top { display: flex; align-items: center; justify-content: space-between; }
.auth-body { display: grid; place-items: center; padding: 24px 0 56px; }
.auth-card {
  display: grid; gap: 16px; width: min(420px, 100%); padding: 28px;
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-xl);
}
.auth-card:has(.managers) { width: min(560px, 100%); }
.auth-head p { margin-top: 6px; }
.auth-head h1 { font-size: 26px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.managers { display: grid; gap: 8px; }
.manager { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto; gap: 8px; align-items: center; }
.add-manager { justify-self: start; }
.auth-error { color: var(--danger); font-size: 13px; }

.account-list { display: grid; gap: 6px; }
.account-row {
  display: flex; align-items: center; gap: 12px; width: 100%; height: 50px; padding: 0 14px;
  background: var(--raised); border-radius: var(--r-md); text-align: left; font-weight: 500;
  transition: background var(--dur) var(--ease);
}
.account-row:hover { background: var(--raised-hover); }
.account-row-name { flex: 1; min-width: 0; }
.account-row .avatar { width: 28px; height: 28px; }
.tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px;
  background: var(--bg); color: var(--text-2); font-size: 11px; font-weight: 500;
}
.tag svg { width: 12px; height: 12px; }
.account-ask { display: grid; }
.ask-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 6px; }

@media (max-width: 560px) {
  .auth { padding: 12px 16px; }
  .auth-card { padding: 22px 18px; border: 0; background: transparent; }
  .auth-body { place-items: start center; padding-top: 12px; }
  .field-row { grid-template-columns: 1fr; }
  .manager { grid-template-columns: minmax(0, 1fr) auto; }
  .manager > :nth-child(2) { grid-column: 1; }
  .manager .check { grid-column: 1; }
  .manager > :last-child { grid-row: 1; grid-column: 2; }
}

/* ---- Dialog "Вид" ---- */

.looks { display: grid; gap: 18px; }
.look-section { display: grid; gap: 8px; }
.themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.theme {
  display: grid; gap: 6px; padding: 6px; border: 1px solid var(--line-soft); border-radius: var(--r-md);
  color: var(--text-2); font-size: 12px; font-weight: 500; text-align: center; transition: border-color var(--dur) var(--ease);
}
.theme:hover { border-color: var(--line); }
.theme.is-on { border-color: var(--text); color: var(--text); }
.theme-preview { position: relative; display: block; height: 58px; border-radius: var(--r-sm); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(128, 128, 128, .18); }
.tp-bar { position: absolute; left: 8px; right: 8px; top: 10px; height: 12px; border-radius: 4px; }
.tp-short { top: 28px; right: 38px; }
.tp-dot { position: absolute; right: 9px; bottom: 9px; width: 14px; height: 14px; border-radius: 50%; }
.accents { display: flex; flex-wrap: wrap; gap: 10px; }
.accent { display: grid; place-items: center; width: 32px; height: 32px; border: 2px solid transparent; border-radius: 50%; transition: border-color var(--dur) var(--ease); }
.accent.is-on { border-color: var(--text); }
.accent-dot { width: 20px; height: 20px; border-radius: 50%; }
.accent-dot.auto { background: linear-gradient(135deg, var(--text) 50%, var(--bg) 50%); box-shadow: inset 0 0 0 1px var(--line); }

/* ---- Dialog "Аккаунты" ---- */

.account-manage { display: grid; gap: 2px; }
.manage-row { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.manage-name { flex: 1; min-width: 0; font-weight: 500; }
