:root {
    --slate-900: #2f3338;   /* тёмный из круга лого */
    --slate-700: #4a4f57;
    --slate-500: #6b7079;
    --slate-200: #d9dbdf;
    --slate-100: #eef0f2;
    --red: #c8202f;         /* лента лого */
    --red-dark: #a3121f;
    --white: #ffffff;
    --serif: Georgia, "Times New Roman", serif;
    --sans: "Segoe UI", Roboto, Arial, sans-serif;
    --radius: 6px;
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }
  html, body { height: 100%; }
  body {
    font-family: var(--sans);
    color: var(--slate-900);
    background: var(--slate-100);
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
  }

  /* ---------- Sidebar ---------- */
  .sidebar {
    background: linear-gradient(180deg, var(--slate-700) 0%, var(--slate-900) 100%);
    color: var(--white);
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    position: sticky;
    top: 0;
    height: 100vh;
  }
  .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,.12);
  }
  .brand img { width: 56px; height: 56px; border-radius: 50%; background: var(--white); }
  .brand-name { font-family: var(--serif); font-size: 20px; line-height: 1.1; }
  .brand-name span { display: block; font-size: 12px; color: var(--slate-200); font-family: var(--sans); margin-top: 4px; }

  .nav { display: flex; flex-direction: column; margin-top: 12px; }
  .nav-group { padding: 12px 20px 4px; font-size: 12px; color: var(--slate-200); }
  .nav button {
    all: unset;
    cursor: pointer;
    padding: 11px 20px;
    font-size: 15px;
    color: var(--white);
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .nav button:hover { background: rgba(255,255,255,.06); }
  .nav button.active { background: rgba(255,255,255,.1); border-left-color: var(--red); }
  .nav button:focus-visible { outline: 2px solid var(--red); outline-offset: -2px; }
  .nav .tag {
    margin-left: auto;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    background: var(--red);
  }
  .nav .tag.soon { background: var(--slate-500); }

  .sidebar-footer { margin-top: auto; padding: 16px 20px 0; border-top: 1px solid rgba(255,255,255,.12); font-size: 13px; color: var(--slate-200); }
  .role-switch { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
  .role-switch button {
    all: unset; cursor: pointer;
    font-size: 12px; padding: 4px 8px; border-radius: 3px;
    border: 1px solid rgba(255,255,255,.3);
  }
  .role-switch button.active { background: var(--red); border-color: var(--red); }

  /* ---------- Main ---------- */
  .main { display: flex; flex-direction: column; min-width: 0; }
  .topbar {
    background: var(--white);
    border-bottom: 1px solid var(--slate-200);
    padding: 14px 32px;
    display: flex;
    align-items: center;
    gap: 16px;
  }
  .topbar h1 { font-family: var(--serif); font-size: 22px; font-weight: normal; }
  .topbar .spacer { flex: 1; }
  .lang { display: flex; border: 1px solid var(--slate-200); border-radius: var(--radius); overflow: hidden; }
  .lang button { all: unset; cursor: pointer; padding: 6px 12px; font-size: 13px; }
  .lang button.active { background: var(--slate-900); color: var(--white); }
  .user { display: flex; align-items: center; gap: 10px; font-size: 14px; }
  .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--slate-200); }

  .content { padding: 32px; }
  .screen { display: none; }
  .screen.active { display: block; }

  .lead { color: var(--slate-500); max-width: 60ch; margin-bottom: 24px; }

  /* Buttons */
  .btn {
    all: unset;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 14px;
    border-radius: var(--radius);
    border: 1px solid transparent;
  }
  .btn:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
  .btn-primary { background: var(--red); color: var(--white); }
  .btn-primary:hover { background: var(--red-dark); }
  .btn-dark { background: var(--slate-900); color: var(--white); }
  .btn-dark:hover { background: var(--slate-700); }
  .btn-outline { background: var(--white); color: var(--slate-900); border-color: var(--slate-200); }
  .btn-outline:hover { border-color: var(--slate-500); }
  .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }

  /* Panels (заглушки) */
  .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
  .panel {
    background: var(--white);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius);
    padding: 20px;
  }
  .panel h3 { font-family: var(--serif); font-weight: normal; font-size: 18px; margin-bottom: 6px; }
  .panel p { font-size: 14px; color: var(--slate-500); margin-bottom: 14px; }
  .panel-top { border-top: 4px solid var(--red); }

  .placeholder {
    border: 2px dashed var(--slate-200);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    color: var(--slate-500);
    background: var(--white);
  }
  .placeholder strong { display: block; color: var(--slate-900); margin-bottom: 6px; font-weight: normal; font-family: var(--serif); font-size: 18px; }

  table { width: 100%; border-collapse: collapse; background: var(--white); font-size: 14px; }
  th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--slate-200); }
  th { background: var(--slate-900); color: var(--white); font-weight: normal; }

  /* Login overlay */
  .login {
    position: fixed; inset: 0; z-index: 10;
    background: linear-gradient(135deg, var(--slate-700), var(--slate-900));
    display: flex; align-items: center; justify-content: center;
  }
  .login.hidden { display: none; }
  .login-card {
    background: var(--white);
    width: 380px;
    max-width: 92vw;
    border-radius: 10px;
    padding: 32px;
    text-align: center;
    border-top: 6px solid var(--red);
  }
  .login-card img { width: 110px; height: 110px; margin-bottom: 12px; }
  .login-card h2 { font-family: var(--serif); font-weight: normal; font-size: 24px; margin-bottom: 4px; }
  .login-card p { color: var(--slate-500); font-size: 14px; margin-bottom: 20px; }
  .login-card input {
    width: 100%; padding: 10px 12px; margin-bottom: 10px;
    border: 1px solid var(--slate-200); border-radius: var(--radius); font-size: 14px;
  }
  .login-card .btn { width: 100%; justify-content: center; margin-top: 6px; }

  @media (max-width: 800px) {
    body { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; }
    .content { padding: 20px; }
  }

/* ---- формы и вопросы ---- */
.form { background: var(--white); border: 1px solid var(--slate-200); border-radius: var(--radius); padding: 20px; max-width: 640px; margin-bottom: 24px; }
.form label { display: block; font-size: 13px; color: var(--slate-500); margin-bottom: 4px; }
.form input[type=text], .form textarea { width: 100%; padding: 10px 12px; margin-bottom: 12px; border: 1px solid var(--slate-200); border-radius: var(--radius); font-size: 14px; font-family: inherit; }
.form textarea { min-height: 110px; resize: vertical; }
.form .check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 14px; }
.hidden { display: none !important; }
.q-list { display: flex; flex-direction: column; gap: 12px; }
.q { background: var(--white); border: 1px solid var(--slate-200); border-left: 4px solid var(--slate-500); border-radius: var(--radius); padding: 16px 20px; }
.q.answered { border-left-color: var(--red); }
.q-head { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; margin-bottom: 6px; }
.q-head h4 { font-family: var(--serif); font-weight: normal; font-size: 17px; }
.q-meta { font-size: 12px; color: var(--slate-500); }
.q-body { font-size: 14px; white-space: pre-wrap; }
.q-answer { margin-top: 12px; padding: 12px 14px; background: var(--slate-100); border-radius: var(--radius); font-size: 14px; white-space: pre-wrap; }
.q-answer .q-meta { margin-bottom: 4px; }
.q-reply { margin-top: 12px; }
.q-reply textarea { width: 100%; min-height: 80px; padding: 10px 12px; border: 1px solid var(--slate-200); border-radius: var(--radius); font-family: inherit; font-size: 14px; margin-bottom: 8px; }
.status { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 3px; background: var(--slate-200); }
.status.answered { background: var(--red); color: var(--white); }
.msg { font-size: 14px; padding: 10px 14px; border-radius: var(--radius); margin-bottom: 12px; }
.msg.error { background: #fbe4e6; color: var(--red-dark); }
.msg.ok { background: #e6f2e8; color: #1f6b34; }
