@import url("https://fonts.googleapis.com/css2?family=Golos+Text:wght@400;500;600;700&display=swap");

/* Edpro Brandbook 2026 — master palette */
:root {
  --ink: #1f2937;
  --accent: #10c3ff;
  --muted: #7a8393;
  --line: #e5e7eb;
  --white: #ffffff;
  --bg: #f9faf7;
  --card: #ffffff;
  --accent-soft: rgba(16, 195, 255, 0.12);
  --ink-soft: rgba(31, 41, 55, 0.06);
  --warn: #b45309;
  --danger: #b91c1c;
  --ok: #15803d;
  --psych: #8b5cf6;
  --coach: #ffa808;
  --shadow: 0 12px 32px rgba(31, 41, 55, 0.06);
  --radius: 14px;
  --font: "Golos Text", Arial, Helvetica, sans-serif;
  font-family: var(--font);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, #ffffff 0%, var(--bg) 42%, #f3f5f0 100%);
  font-family: var(--font);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(31, 41, 55, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 41, 55, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, #000 20%, transparent 75%);
  opacity: 0.55;
  z-index: 0;
}

a { color: inherit; text-decoration: none; }

.wrap {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding-bottom: 2.5rem;
}

.topbar {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  padding: 1.35rem 0 0.85rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.brand-logo {
  display: block;
  height: 40px;
  width: auto;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.brand-copy strong {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.brand-copy span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.45rem 0.35rem 0.85rem;
  display: flex;
  gap: 0.65rem;
  align-items: center;
  box-shadow: var(--shadow);
  font-size: 0.88rem;
}

.user-name {
  color: var(--muted);
  max-width: 16rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-shell {
  position: relative;
  margin: 2.2rem auto 1rem;
  max-width: 34rem;
}

.auth-shell::before,
.auth-shell::after {
  content: "";
  position: absolute;
  background: var(--accent);
  opacity: 0.55;
  pointer-events: none;
}

.auth-shell::before {
  left: 12%;
  top: -18px;
  width: 1px;
  height: calc(100% + 36px);
}

.auth-shell::after {
  top: 18%;
  left: -18px;
  height: 1px;
  width: calc(100% + 36px);
}

.auth-arrow {
  position: absolute;
  left: calc(12% - 7px);
  top: calc(18% - 7px);
  width: 14px;
  height: 14px;
  z-index: 2;
}

.auth-box {
  position: relative;
  z-index: 1;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.7rem 1.55rem 1.45rem;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}

.auth-brand img {
  width: 44px;
  height: 44px;
}

.auth-brand span {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.35;
}

.auth-box h1 {
  margin: 0 0 0.45rem;
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.auth-box > p {
  margin: 0 0 1.1rem;
  color: var(--muted);
  line-height: 1.45;
}

.role-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.role-option {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 0.8rem;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.role-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.role-option strong {
  display: block;
  font-size: 0.98rem;
  font-weight: 600;
}

.role-option small {
  display: block;
  color: var(--muted);
  line-height: 1.35;
  margin-top: 0.2rem;
}

.field {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
  font-size: 0.86rem;
  color: var(--muted);
}

.field input {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  font: inherit;
  color: var(--ink);
  background: white;
  width: 100%;
}

.field input:focus {
  outline: 2px solid rgba(16, 195, 255, 0.35);
  border-color: var(--accent);
}

.password-wrap { display: flex; gap: 0.45rem; align-items: stretch; }
.password-wrap input { flex: 1; }

.password-toggle {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  border-radius: 12px;
  padding: 0 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
}

.password-toggle[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--ink);
}

.flash-error {
  background: #fee2e2;
  color: var(--danger);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  font-size: 0.9rem;
}

.auth-box .btn { width: 100%; margin-top: 0.35rem; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 600;
}

.badge.psych { background: rgba(139, 92, 246, 0.12); color: #6d28d9; }
.badge.coach { background: rgba(255, 168, 8, 0.16); color: #b45309; }

.hero { margin: 1.35rem 0 1.5rem; position: relative; }

.hero h1 {
  margin: 0.45rem 0 0.5rem;
  font-size: clamp(1.7rem, 3.6vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.12;
  color: var(--ink);
}

.hero p {
  margin: 0;
  color: var(--muted);
  max-width: 42rem;
  line-height: 1.5;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--accent);
}

.card.program-pk,
.card.program-ta { border-top-color: var(--psych); }

.card.program-icf { border-top-color: var(--coach); }

.card h2,
.card h3 {
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.card .meta {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.card .actions { margin-top: 1rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.72rem 1.05rem;
  border-radius: 12px;
  background: var(--ink);
  color: white;
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 600;
  border: 0;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}

.btn:hover { background: #111827; }

.btn.secondary {
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn.secondary:hover { background: var(--bg); }

.btn.accent {
  background: var(--accent);
  color: var(--ink);
}

.progress {
  margin-top: 0.9rem;
  height: 8px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #0aa8de, var(--accent));
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.toolbar input,
.toolbar select {
  border: 1px solid var(--line);
  background: white;
  border-radius: 12px;
  padding: 0.7rem 0.95rem;
  min-width: 180px;
  font: inherit;
  color: var(--ink);
}

.toolbar input:focus,
.toolbar select:focus {
  outline: 2px solid rgba(16, 195, 255, 0.35);
  border-color: var(--accent);
}

.table-wrap {
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th,
td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #f7f8f5;
}

tr:last-child td { border-bottom: 0; }
tr:hover td { background: rgba(16, 195, 255, 0.04); }

.staff-table-wrap { max-width: 100%; }
.staff-table .col-fio { white-space: normal; min-width: 12rem; max-width: 22rem; }

.staff-table .col-action {
  position: sticky;
  right: 0;
  z-index: 2;
  background: var(--card);
  box-shadow: -8px 0 12px rgba(31, 41, 55, 0.04);
  min-width: 7.5rem;
}

.staff-table thead .col-action {
  background: #f7f8f5;
  z-index: 3;
}

.staff-table tr:hover .col-action { background: #f0fbff; }

.status {
  display: inline-flex;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: #f5f5f4;
}

.status.ok { background: #dcfce7; color: var(--ok); }
.status.wait { background: #ffedd5; color: var(--warn); }
.status.bad { background: #fee2e2; color: var(--danger); }
.status.draft { background: #e7e5e4; color: #57534e; }

.journal-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 1rem; }

@media (max-width: 860px) {
  .journal-grid { grid-template-columns: 1fr; }
  .user-panel { border-radius: 14px; flex-wrap: wrap; }
  .role-grid { grid-template-columns: 1fr; }
  .brand-copy span { display: none; }
  .auth-shell::before,
  .auth-shell::after,
  .auth-arrow { display: none; }
}

.kv { display: grid; gap: 0.65rem; }
.kv div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}
.kv strong { font-weight: 600; }
.kv span { color: var(--muted); text-align: right; }

.note {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.journal-stack { display: grid; gap: 1.1rem; margin-bottom: 2.25rem; }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.15rem 0.85rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #f7f8f5);
}

.panel-head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
}

.table-wrap.inset {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table thead th {
  background: #f7f8f5;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.data-table tbody th {
  width: 38%;
  text-align: left;
  font-weight: 600;
  color: var(--ink);
  padding: 0.78rem 1rem;
  border-bottom: 1px solid var(--line);
  background: #fbfcf9;
  white-space: normal;
}

.data-table td {
  padding: 0.78rem 1rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  white-space: nowrap;
}

.data-table td.wrap,
.data-table th.wrap { white-space: normal; line-height: 1.4; }

.data-table tr:last-child th,
.data-table tr:last-child td { border-bottom: 0; }

.data-table tbody tr:hover td,
.data-table tbody tr:hover th { background: rgba(16, 195, 255, 0.04); }

.practices-table td.date-cell {
  color: #0aa8de;
  font-weight: 650;
  white-space: normal;
  min-width: 9rem;
}

.practices-table tr.row-done td { background: #f0fdf4; }
.practices-table tr.row-done:hover td { background: #e7f9ee; }

.risk {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: #f5f5f4;
  color: #57534e;
}

.risk-ok { background: #d9ead3; color: #1b5e20; }
.risk-bad { background: #f4cccc; color: #8b1a1a; }
.risk-na { background: #e7e6e6; color: #5f5f5f; }
.risk-row td { background: #fff8f8; }
.muted { color: var(--muted); }

@media (max-width: 720px) {
  .data-table thead { display: none; }
  .practices-table tr {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.25rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--line);
  }
  .practices-table td {
    border: 0;
    padding: 0.15rem 1rem;
    white-space: normal;
  }
  .practices-table tr.row-done { background: #f0fdf4; }
}
