/* Штаб — единственный файл стилей. Цвета, размеры и скругления — из макетов (canvas/project). */
:root {
  --ink: #121317;
  --page: #ECEEF3;
  --card: #FFFFFF;
  --muted: #5B6372;
  --muted-2: #6B7280;
  --line: #E3E6EB;
  --link: #3F4FD8;
  --accent: #C6F432;
  --ok: #17804F;
  --danger: #B5300F;
  --sb-bg: #121317;
  --sb-line: #22252D;
  --sb-text: #B9BCC6;
  --sb-muted: #9A9EA8;
  --sb-active: #2A2C33;
  --sb-btn: #1B1D23;
  --sb-btn-line: #2E313A;
  --font: Inter, system-ui, sans-serif;
  --font-display: Unbounded, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--page); color: var(--ink); font-family: var(--font); font-size: 14px; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- каркас ---------- */
.layout { min-height: 100vh; display: flex; }
.main { flex: 1 1 560px; min-width: 0; padding: 22px 24px 32px; display: flex; flex-direction: column; gap: 14px; }
.main--project { padding: 28px 32px 40px; gap: 18px; }

/* ---------- левое меню ---------- */
.sidebar {
  position: sticky; top: 0; align-self: flex-start; width: 248px; min-height: 100vh; flex: none;
  background: var(--sb-bg); border-right: 1px solid var(--sb-line); padding: 20px 12px;
  display: flex; flex-direction: column; gap: 18px; color: var(--sb-text);
}
.sidebar a:hover { color: #FFFFFF; }
.sb-head { display: flex; align-items: center; gap: 10px; padding: 0 4px; }
.sb-logo {
  width: 32px; height: 32px; flex: none; border-radius: 9px; background: var(--accent); color: var(--ink);
  display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; font-size: 15px;
}
.sb-title { flex: 1; display: flex; flex-direction: column; }
.sb-title b { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: #FFFFFF; }
.sb-title span { font-size: 12px; color: var(--sb-muted); }
.sb-toggle {
  width: 30px; height: 30px; flex: none; border: 1px solid var(--sb-btn-line); background: var(--sb-btn);
  border-radius: 8px; color: var(--sb-text); cursor: pointer;
}
.sb-group { display: flex; flex-direction: column; gap: 2px; }
.sb-caption {
  display: flex; justify-content: space-between; padding: 0 10px 6px; font-size: 12px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--sb-muted);
}
.sb-item {
  display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 10px; border-radius: 8px;
  color: var(--sb-text); font-weight: 500;
}
.sb-item svg { flex: none; }
.sb-item.is-active { background: var(--sb-active); color: var(--accent); }
.sb-label { flex: 1; }
.sb-badge { font-size: 12px; color: var(--sb-muted); white-space: nowrap; }
.sb-badge--hot { color: #FF9A5C; }
.sb-project { min-height: 34px; font-weight: 400; color: #E6E8EE; }
.sb-dot {
  width: 10px; height: 10px; flex: none; border-radius: 5px; background: var(--dot); color: #16181D;
  font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.sb-dot .sb-mini { display: none; }
.sb-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-top: 1px solid var(--sb-line); }
.sb-who { flex: 1; display: flex; flex-direction: column; }
.sb-who b { color: #FFFFFF; font-weight: 600; }
.sb-who span { font-size: 12px; color: var(--sb-muted); }
.sb-logout { background: none; border: 0; color: var(--sb-muted); cursor: pointer; font-size: 12px; padding: 4px; }
.sb-logout:hover { color: #FFFFFF; }

/* свёрнутое меню: класс ставит static/app.js по localStorage */
.sb-collapsed .sidebar { width: 72px; }
.sb-collapsed .sb-head { flex-direction: column; }
.sb-collapsed .sb-title, .sb-collapsed .sb-label, .sb-collapsed .sb-caption,
.sb-collapsed .sb-who, .sb-collapsed .sb-logout, .sb-collapsed .sb-badge { display: none; }
.sb-collapsed .sb-item, .sb-collapsed .sb-foot { justify-content: center; }
.sb-collapsed .sb-dot { width: 24px; height: 24px; }
.sb-collapsed .sb-dot .sb-mini { display: inline; }

/* ---------- общие детали ---------- */
.avatar {
  width: 32px; height: 32px; flex: none; border-radius: 50%; background: #E3E6EB; color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 600;
}
.avatar--dark { background: #2A2C33; color: #FFFFFF; }
.avatar--sm { width: 30px; height: 30px; }
.btn {
  display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border: 0; border-radius: 18px;
  background: var(--card); color: var(--ink); font-weight: 500; cursor: pointer;
}
.btn--dark { background: var(--ink); color: #FFFFFF; font-weight: 600; }
.btn--square { height: 38px; border-radius: 9px; }
.btn--ghost { border: 1px solid #D5DAE2; }
.btn--accent { background: var(--accent); color: var(--ink); font-weight: 600; height: 42px; border-radius: 10px; }
.h1 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 28px; }
.h2 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 22px; }
.row-between { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; }
.panel { background: var(--card); border-radius: 24px; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.panel h2 { margin: 0; font-size: 16px; font-weight: 700; }
.h3 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.caps { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted-2); }
.page-head { display: flex; flex-direction: column; gap: 4px; }
.page-title { display: flex; flex-direction: column; gap: 4px; }
.page-sub { color: var(--muted); }
.text-late { color: #B85A0E; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.link-btn { border: 0; background: none; color: var(--link); font: inherit; font-size: 13px; cursor: pointer; padding: 2px 4px; }
.error { padding: 10px 14px; border-radius: 12px; background: #FFEBDD; color: var(--danger); }
.empty { color: var(--muted); }

/* ---------- цель-миллиард ---------- */
.goal {
  width: 100%; padding: 18px 22px; background: var(--ink); color: #FFFFFF; border-radius: 18px;
  display: flex; flex-direction: column; gap: 16px;
}
/* строки блока: миллиард с таймером; ниже у владельца — прибыль в месяц (goal.css) */
.goal-row { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 28px; }
.goal-col { display: flex; flex-direction: column; gap: 4px; }
.goal-col--title { min-width: 200px; }
.goal-col--pace { min-width: 170px; }
.goal-kicker { font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.goal-sum { font-family: var(--font-display); font-weight: 700; font-size: 26px; line-height: 1; }
.goal-note { color: var(--sb-text); font-size: 12px; }
.goal-note strong { color: #FFFFFF; }
.goal-pace { font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.goal-pace small { font-size: 13px; color: var(--sb-text); }
.goal-timer { display: flex; align-items: flex-end; gap: 10px; }
.goal-part { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--sb-text); }
.goal-digit {
  min-width: 52px; padding: 6px 8px; background: #22252D; border-radius: 10px; text-align: center;
  font-family: var(--font-mono); font-weight: 700; font-size: 26px; font-variant-numeric: tabular-nums; color: #FFFFFF;
}
.goal-digit--days { min-width: 78px; color: var(--accent); }
.goal-track-wrap { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.goal-track-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--sb-text); }
.goal-track-head strong { color: #FFFFFF; }
.goal-track { position: relative; height: 12px; background: #22252D; border-radius: 6px; }
.goal-elapsed { position: absolute; left: 0; top: 0; height: 12px; background: #3A3E48; border-radius: 6px; }
.goal-tick { position: absolute; top: -3px; width: 2px; height: 18px; background: var(--ink); }
.goal-years { position: relative; height: 14px; font-size: 11px; color: var(--sb-text); }
.goal-years span { position: absolute; transform: translateX(-50%); }

/* ---------- Пульт: плитки проектов ---------- */
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 10px; padding: 8px 4px 0; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.tile {
  --tile: #FFFFFF;
  background: var(--tile); color: color-mix(in srgb, var(--tile) 18%, #000000);
  border-radius: 28px; padding: 20px 22px; display: flex; flex-direction: column; gap: 14px;
}
.tile--dark { color: #FFFFFF; }
.tile-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tile-name { font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.tile-chip { padding: 3px 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.5); font-size: 12px; font-weight: 600; }
.tile--dark .tile-chip { background: rgba(255, 255, 255, 0.2); }
.tile-stats { display: flex; gap: 22px; align-items: flex-end; }
.tile-stat { display: flex; flex-direction: column; }
.tile-stat b { font-family: var(--font-display); font-weight: 700; font-size: 34px; line-height: 1; }
.tile-stat--small b { font-size: 22px; line-height: 1.2; }
.tile-stat span { font-size: 12px; opacity: 0.85; }
.tile-next { margin-left: auto; text-align: right; font-size: 13px; }
.tile-links { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; }
.tile-links a { padding: 5px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.45); }
.tile--dark .tile-links a { background: rgba(255, 255, 255, 0.16); }

/* ---------- проект: шапка и вкладки ---------- */
.project-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.project-id { display: flex; align-items: center; gap: 14px; }
.project-badge {
  width: 48px; height: 48px; border-radius: 18px; background: var(--badge); color: color-mix(in srgb, var(--badge) 18%, #000000);
  display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; font-size: 18px;
}
.project-badge--dark { color: #FFFFFF; }
.project-title { display: flex; flex-direction: column; gap: 4px; }
.project-sub { color: var(--muted); font-size: 13px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 500; margin-bottom: -1px; white-space: nowrap; }
.tab.is-active { color: var(--ink); border-bottom-color: var(--ink); }
.soon { background: var(--card); border-radius: 24px; padding: 40px 24px; text-align: center; color: var(--muted); font-size: 15px; }
.soon b { display: block; margin-bottom: 6px; font-family: var(--font-display); font-size: 20px; color: var(--ink); }

/* ---------- ссылки проекта ---------- */
.links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.link-card { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; background: var(--card); border-radius: 22px; min-width: 0; }
.link-card-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; }
.link-card-head span { color: #5A5D66; font-weight: 400; }
.link-url { font-size: 13px; color: var(--link); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-note { font-size: 12px; color: var(--muted-2); }
.link-add { min-height: 96px; border: 2px dashed #C4CAD4; border-radius: 22px; color: #5A5D66; }
.link-add summary { min-height: 92px; display: flex; align-items: center; justify-content: center; cursor: pointer; list-style: none; }
.link-add summary::-webkit-details-marker { display: none; }
.link-add[open] { grid-column: span 2; background: var(--card); border-style: solid; border-color: var(--line); }
.link-add[open] summary { min-height: 44px; }
.link-form { display: flex; flex-direction: column; gap: 8px; padding: 0 18px 16px; }
.field { width: 100%; height: 38px; padding: 0 12px; border: 1px solid #D5DAE2; border-radius: 9px; background: #FFFFFF; color: var(--ink); }
.member { display: flex; align-items: center; gap: 10px; min-height: 44px; border-top: 1px solid #F0F1F4; }
.member-name { flex: 1; font-weight: 500; }
.role-chip { padding: 3px 10px; border-radius: 10px; font-size: 12px; background: #ECEEF3; }
.role-chip--lead { background: #DCE1FF; }
.role-chip--reader { background: #FFF4C7; }

/* ---------- формы входа и нового проекта ---------- */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--sb-bg); }
.auth-card { width: 100%; max-width: 380px; background: var(--card); border-radius: 28px; padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.auth-brand { display: flex; align-items: center; gap: 10px; }
.auth-brand b { font-family: var(--font-display); font-size: 20px; }
.form-label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; }
.form-card { max-width: 560px; }
.form-color { width: 64px; height: 38px; padding: 2px; border: 1px solid #D5DAE2; border-radius: 9px; }

@media (max-width: 1100px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .tiles, .links { grid-template-columns: minmax(0, 1fr); }
  .link-add[open] { grid-column: auto; }
  .main, .main--project { padding: 16px; }
}

/* плашки направлений задач */
.dir { padding: 2px 8px; border-radius: 8px; font-size: 12px; font-weight: 600; }
.dir--sales { background: #E4E7FF; color: #2C3BC4; }
.dir--product { background: #F1E8FF; color: #7A3FC8; }
.dir--marketing { background: #FFF1DD; color: #A85A06; }
.dir--finance { background: #E3F5EA; color: #17804F; }
.dir--team { background: #F0F1F4; color: #3A4150; }
