* { box-sizing: border-box; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  margin: 0;
  background: #f4f5f7;
  color: #1a1a1a;
}

#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

#login-form {
  background: white;
  padding: 32px;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  width: 320px;
}

#login-form h1 { margin-top: 0; font-size: 20px; }
#login-form input {
  display: block;
  width: 100%;
  padding: 8px;
  margin-bottom: 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
}
#login-form button, .btn {
  background: #2b6cb0;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
}
#login-form button:hover, .btn:hover { background: #2c5282; }
#login-error { color: #c53030; font-size: 13px; min-height: 18px; }

#app-screen { display: none; }
header {
  background: #1a365d;
  color: white;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
header h1 { font-size: 16px; margin: 0; }
#who { font-size: 13px; opacity: 0.85; }
#logout-btn { background: transparent; border: 1px solid rgba(255,255,255,0.5); color: white; }

nav {
  display: flex;
  gap: 4px;
  background: white;
  padding: 8px 20px 0;
  border-bottom: 1px solid #ddd;
  flex-wrap: wrap;
}
nav button {
  background: none;
  border: none;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-size: 14px;
}
nav button.active { border-bottom-color: #2b6cb0; font-weight: 600; }

main { padding: 20px; max-width: 1100px; margin: 0 auto; }
.panel { display: none; }
.panel.active { display: block; }

table { border-collapse: collapse; width: 100%; background: white; margin-bottom: 16px; }
th, td { text-align: left; padding: 6px 10px; border-bottom: 1px solid #eee; font-size: 13px; }
th { background: #f0f2f5; }

.card { background: white; padding: 16px; border-radius: 6px; margin-bottom: 16px; box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.card h3 { margin-top: 0; margin-bottom: 0; font-size: 14px; }
.card h2 { margin-bottom: 0; }
.card form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; margin-top: 10px; }
.field { display: flex; flex-direction: column; font-size: 12px; max-width: 220px; }
.field label { margin-bottom: 3px; color: #555; }
.field input, .field select { padding: 6px; border: 1px solid #ccc; border-radius: 4px; min-width: 120px; }

/* Подсказки: заголовок/метка + кружок "?" в одной строке, текст
 * пояснения строкой ниже, по умолчанию свёрнут. */
.help-header { display: flex; align-items: center; gap: 6px; }
.field-label-row { margin-bottom: 3px; }
.help-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  min-width: 16px;
  border-radius: 50%;
  background: #cbd5e0;
  color: #2d3748;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  user-select: none;
}
.help-badge:hover, .help-badge:focus { background: #a0aec0; outline: none; }
.help-text {
  display: none;
  background: #edf2f7;
  border-left: 3px solid #a0aec0;
  padding: 8px 10px;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.4;
  color: #2d3748;
  border-radius: 4px;
  max-width: 480px;
  font-weight: normal;
  white-space: normal;
}
.help-text.open { display: block; }
h2 .help-text, h3 .help-text { display: none; } /* подстраховка от вложенности, реально не вложено */

.flash { padding: 8px 12px; border-radius: 4px; margin-bottom: 12px; font-size: 13px; }
.flash.error { background: #fed7d7; color: #822727; }
.flash.ok { background: #c6f6d5; color: #22543d; }

.filters { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.filters input { padding: 6px; border: 1px solid #ccc; border-radius: 4px; }
