/* Проекты: карточки, обзор и бюджет, команда и роли, статусы, вход. Файлы стилей подключаются в templates/base.html по порядку. */

/* ===== Проекты ===== */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; margin-bottom: 36px; }
.project-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  color: var(--text);
  transition: box-shadow .15s, border-color .15s, transform .15s;
}
.project-card:hover { color: var(--text); box-shadow: var(--shadow-hover); border-color: var(--border-strong); transform: translateY(-1px); }
.project-card .name { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 650; }
.project-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent-ink);
  color: var(--accent);
  font-weight: 700;
  font-size: 15px;
  flex: none;
}
.project-card .desc { color: var(--text-2); font-size: 13.5px; min-height: 21px; }
.project-card .stats { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 13px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
.project-card .stats span { display: inline-flex; align-items: center; gap: 5px; }
.project-card .stats .avatars { margin-left: auto; }

/* ===== Обзор проекта и бюджет ===== */
.overview { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
.overview > * { min-width: 0; }
.budget-numbers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 18px; }
.budget-value { font-size: clamp(17px, 1.9vw, 24px); font-weight: 750; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.budget-value.remaining { color: var(--ok); }
.budget-card.over .budget-value.remaining { color: var(--danger); }
.budget-bar { height: 10px; border-radius: 999px; background: var(--grey-soft); overflow: hidden; }
.budget-bar span { display: block; height: 100%; border-radius: 999px; background: var(--accent); min-width: 2px; }
.budget-card.over .budget-bar span { background: var(--danger); }
.budget-caption { margin-top: 8px; font-size: 13px; }
.customer { font-size: 16px; font-weight: 600; margin: 0; }
.member { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.card-head + .member { border-top: none; }
.member-info { flex: 1; min-width: 0; }
.member-name { font-weight: 600; }
.member-tasks { color: var(--text-2); font-size: 13px; white-space: nowrap; }

/* ===== Роли в проекте ===== */
.team-roles { width: 100%; }
.team-roles td { padding: 8px 6px; border-bottom: 1px solid var(--border); }
.team-roles tr:last-child td { border-bottom: none; }
.team-roles select { width: 220px; height: 34px; }
.role-badge { font-size: 12.5px; }

/* ===== Команда ===== */
.role-form { display: flex; gap: 8px; align-items: center; margin: 0; }
.role-form select { width: 180px; height: 34px; }
.role-form button { height: 34px; }

/* ===== Настройка статусов проекта ===== */
.status-table th:nth-child(1) { width: 34%; }
.status-row-cell { padding: 6px 12px; }
.status-row { display: grid; grid-template-columns: minmax(180px, 1fr) 170px 150px 60px 220px; gap: 14px; align-items: center; margin: 0; }
.status-table thead tr { display: grid; grid-template-columns: minmax(180px, 1fr) 170px 150px 60px 220px; gap: 14px; padding: 0 12px; }
.status-table thead th { padding: 10px 0; border: none; background: none; }
.status-table thead { display: block; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.status-table tbody, .status-table tbody tr, .status-table tbody td { display: block; }
.status-row input[type=text] { height: 36px; }
.status-col-done { display: flex !important; align-items: center; gap: 8px; margin: 0 !important; font-weight: 500 !important; }
.status-col-actions { display: flex; gap: 4px; justify-content: flex-end; }
.status-col-actions .icon-only { font-size: 16px; }
.form-card .status-row { grid-template-columns: minmax(180px, 1fr) 170px 150px auto; }
.status-preview { display: flex; flex-wrap: wrap; gap: 8px; }
/* ===== Вход ===== */
.login-page { min-height: calc(100vh - 140px); display: grid; place-items: center; }
.login { width: 400px; text-align: center; padding: 44px 40px; }
.login-logo { width: 56px; height: 66px; margin: 0 auto 20px; display: block; }
.login h1 { font-size: 22px; margin-bottom: 8px; }
.login p { color: var(--muted); margin-bottom: 26px; }
.google-button {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 44px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow);
}
.google-button:hover { background: var(--surface-2); color: var(--text); border-color: var(--muted); }

/* ===== Из чего складывается «Потрачено» (вкладка «Обзор») ===== */
.budget-breakdown { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); display: grid; gap: 6px; }
.budget-breakdown > div:not(.small) { display: flex; justify-content: space-between; gap: 12px; }
.budget-breakdown strong { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ===== Дедлайн проекта (главная и «Обзор») ===== */
.deadline { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.deadline .icon { width: 14px; height: 14px; }
.deadline.soon { color: var(--warn); font-weight: 600; }
.deadline.overdue { color: var(--danger); font-weight: 600; }
.card-deadline { margin: 8px 0 2px; }
.deadline-big .deadline { font-size: 15px; }

/* ===== Планируемый бюджет («Обзор») ===== */
.plan-notes { margin-top: 12px; line-height: 1.6; }

/* ===== Вход и регистрация по почте и паролю ===== */
.login-form { text-align: left; }
.login-field { margin-bottom: 14px; }
.field-error { display: block; margin-top: 4px; color: var(--danger); font-size: 13px; }
.login-submit { width: 100%; height: 42px; margin-top: 4px; }
.login-forgot { display: block; margin-top: 12px; text-align: center; font-size: 13.5px; }
.login-or { display: flex; align-items: center; gap: 12px; margin: 22px 0 16px; color: var(--muted); font-size: 13px; }
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
p.login-note { margin: 18px 0 0; font-size: 13px; }
.login .hint { margin: -6px 0 14px; }
.login-submit { justify-content: center; }

/* ===== Вехи проекта («Обзор») ===== */
:root { --milestone: #7c3aed; }  /* фиолетовый — чтобы отличать от «сегодня» (синий) и дедлайна (красный) */
.milestone-list { display: grid; gap: 2px; margin-bottom: 10px; }
.milestone { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.milestone form { margin: 0 0 0 auto; }
.milestone-mark { width: 10px; height: 10px; transform: rotate(45deg); background: var(--milestone); border-radius: 2px; flex: none; }
.milestone-main { min-width: 0; }
.milestone-title { font-weight: 550; }
.milestone.past .milestone-title { color: var(--muted); }
.milestone.past .milestone-mark { opacity: .4; }
.milestone-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; margin-top: 8px; }
.milestone-form > input[type=text] { grid-column: 1 / -1; }
.milestone-form p { margin: 0; }
.milestone-form .milestone-add { width: var(--control-h, 40px); height: var(--control-h, 40px); justify-content: center; }

/* ===== Комментарии к проекту ===== */
#comments .comment-form { margin: 4px 0 8px; }
.comment-delete { display: inline; margin-left: 6px; }
.comment-delete button { width: 24px; height: 24px; vertical-align: middle; }

/* ===== «Обзор»: короткие карточки справа ===== */
.overview > div > .card + .card { margin-top: 0; }
.card-compact { padding: 16px 18px; }
.card-compact .card-head { margin-bottom: 10px; }
.card-compact .card-head h2 { font-size: 15px; }
.about-list { display: grid; gap: 8px; margin: 0 0 8px; }
.about-list > div { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.about-list dt { color: var(--muted); font-size: 12.5px; }
.about-list dd { margin: 0; overflow-wrap: anywhere; }
.about-list .deadline { font-size: 13.5px; }
.overview .description { white-space: normal; line-height: 1.6; }
.contract-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--border); color: var(--text); }
.contract-row > .small { grid-column: 2; }
.contract-row:first-of-type { border-top: none; }
.contract-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.plan-card .budget-numbers { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }

/* ===== Общедоступные страницы: «О сервисе», «Политика конфиденциальности» ===== */
.public-page { max-width: 760px; margin: 24px auto; }
.public-page > .logo { margin-bottom: 18px; }
.public-card { padding: 28px 32px; line-height: 1.65; }
.public-card h1 { margin-top: 0; }
.public-card h2 { font-size: 17px; margin: 22px 0 6px; }
.public-links { text-align: center; margin-top: 14px; }

/* Значок проекта — эмодзи вместо буквы (выбор по клику в шапке проекта, project-icon.js) */
.project-mark.emoji { background: none; font-size: 26px; font-weight: 400; line-height: 1; }
.project-mark.small.emoji { font-size: 16px; }
.project-icon-picker { position: relative; display: inline-flex; }
.project-icon-button { height: auto; padding: 2px; border: 0; background: none; border-radius: 8px; box-shadow: none; }
.project-icon-button:hover { background: var(--grey-soft); }
.project-icon-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; width: 300px; padding: 8px;
  background: var(--surface); border-radius: 12px; box-shadow: 0 0 0 1px rgba(15, 15, 15, .05), 0 3px 6px rgba(15, 15, 15, .1), 0 9px 24px rgba(15, 15, 15, .2); }
.project-icon-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.project-icon-grid button { height: 34px; padding: 0; justify-content: center; border: 0; border-radius: 8px; background: none; font-size: 20px; box-shadow: none; }
.project-icon-grid button:hover { background: var(--grey-soft); }
.project-icon-grid button[aria-pressed="true"] { background: var(--grey-soft); box-shadow: inset 0 0 0 1.5px var(--text); }
.project-icon-reset { width: 100%; justify-content: center; margin-top: 6px; }

/* ===== Оформление в духе Notion (27.10.2026) — уточняет правила выше ===== */
/* ===== Карточки проектов на главной: как галерея Notion ===== */
.project-card { border-radius: var(--radius); transition: background .1s; }
.project-card:hover { box-shadow: none; background: var(--surface-2); text-decoration: none; }

/* Буква вместо значка — светло-серая, как пустая иконка страницы в Notion */
.project-mark { background: rgba(55, 53, 47, .08); color: var(--text-2); border-radius: 8px; }
.project-mark.small { border-radius: 6px; }
.project-icon-grid button { background: none; color: inherit; }
.project-icon-button, .project-icon-button:hover { color: inherit; }
.project-icon-button { background: none; border: 0; }
.project-icon-button:hover { background: var(--hover-strong); }

/* ===== «Обзор» проекта: свойства под названием, блоки — разделы страницы без рамок ===== */
.details.project-props { max-width: 640px; margin: -4px 0 24px; }
.overview { gap: 40px; }
.overview .card { border: 0; border-radius: 0; padding: 0; background: none; margin: 0 0 32px; }
.overview .card-head { padding-bottom: 8px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.overview .card-head h2 { font-size: 16px; }
.overview .budget-card.over { box-shadow: none; }
