:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #eef5f2;
  --ink: #17212b;
  --muted: #667085;
  --line: #d9e2e7;
  --brand: #0f7b65;
  --brand-dark: #075845;
  --accent: #c79531;
  --danger: #b42318;
  --shadow: 0 18px 45px rgba(22, 38, 55, 0.12);
  font-family: Tahoma, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
textarea {
  font: inherit;
}

button,
.admin-link {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  padding: 0 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 700;
}

button:hover,
.admin-link:hover {
  background: var(--brand-dark);
}

.ghost-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.ghost-button:hover {
  background: #f2f5f7;
}

.icon-button {
  width: 42px;
  padding: 0;
  border-radius: 50%;
  font-size: 28px;
  line-height: 1;
}

.hidden {
  display: none !important;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.login-panel,
.profile-tab,
.admin-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-panel {
  min-height: 360px;
  padding: clamp(24px, 5vw, 48px);
  display: grid;
  gap: 24px;
  align-content: center;
}

.eyebrow {
  color: var(--accent);
  font-weight: 800;
  margin: 0 0 8px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(28px, 4vw, 42px);
}

h2 {
  margin-bottom: 0;
  font-size: 26px;
}

label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: #fff;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

.inline-field {
  display: flex;
  gap: 10px;
}

.inline-field input {
  min-width: 0;
}

.form-note {
  color: var(--muted);
  margin: 10px 0 0;
  line-height: 1.8;
}

.error-message {
  color: var(--danger);
  font-weight: 700;
  min-height: 24px;
  margin: 10px 0 0;
}

.topbar,
.results-heading,
.modal-header,
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 20px;
}

.top-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-tab {
  padding: 24px;
  overflow: hidden;
}

.results-heading {
  margin-bottom: 22px;
}

.guide-button {
  background: #f7fbf9;
  color: var(--brand-dark);
  border: 1px solid #b8d8cd;
}

.guide-button:hover {
  color: #fff;
}

.guide-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}

.results-loading,
.results-empty-state {
  padding: 24px;
  text-align: center;
}

.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  display: inline-block;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.results-container {
  display: grid;
  gap: 16px;
}

.result-row-block {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.result-row-label {
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
  font-weight: 800;
}

.result-row-content {
  min-width: 0;
  overflow-x: auto;
}

.result-sub-title {
  padding: 14px 16px;
  color: var(--brand-dark);
  font-weight: 800;
  background: var(--surface-soft);
}

.result-table {
  min-width: 760px;
}

.result-table-header,
.result-table-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(110px, 1fr);
}

.result-table-header {
  background: #f0f3f5;
  font-weight: 800;
  color: #344054;
}

.result-cell {
  padding: 14px 12px;
  border-left: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.5;
}

.highlight-cell {
  background: #fff7e6;
  color: #8a5b12;
  font-weight: 900;
}

.result-total-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  border: 1px solid #b8d8cd;
  border-radius: 8px;
  padding: 18px;
  background: #f8fcfa;
  font-weight: 800;
}

.result-total-points {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.total-points-box {
  min-width: 86px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  text-align: center;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.faq-modal-panel {
  width: min(760px, 100%);
  max-height: min(760px, calc(100vh - 56px));
  overflow: auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.faq-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.faq-question {
  width: 100%;
  min-height: 54px;
  background: #fff;
  color: var(--ink);
  border-radius: 0;
  justify-content: space-between;
  padding: 12px 16px;
  text-align: right;
}

.faq-question:hover {
  background: #f8fbfa;
  color: var(--ink);
}

.faq-question .plus {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 50%;
  border: 1px solid #b8d8cd;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  font-size: 22px;
}

.faq-item.open .plus {
  background: var(--brand);
  color: #fff;
}

.faq-answer {
  display: none;
  padding: 0 16px 16px;
  color: #344054;
  line-height: 1.9;
}

.faq-item.open .faq-answer {
  display: block;
}

.faq-tools {
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  margin-top: 14px;
}

.faq-meta {
  color: var(--muted);
  font-size: 14px;
}

.comment-row {
  display: flex;
  gap: 10px;
}

.comment-row input {
  min-width: 0;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.95fr) minmax(360px, 1.3fr);
  gap: 18px;
  align-items: start;
}

.admin-panel {
  padding: 22px;
}

.admin-panel h2 {
  font-size: 22px;
  margin-bottom: 18px;
}

.admin-panel label:not(.check-row) {
  margin-top: 14px;
}

.check-row,
.settings-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-row {
  flex-wrap: wrap;
  margin: 16px 0;
}

.check-row {
  margin: 10px 0;
}

.check-row input {
  width: 18px;
  height: 18px;
}

.admin-list {
  display: grid;
  gap: 12px;
}

.admin-faq-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.admin-faq-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.danger {
  background: var(--danger);
}

.danger:hover {
  background: #8e1f16;
}

.employee-table {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
}

.employee-row {
  min-width: 620px;
  display: grid;
  grid-template-columns: 1fr 1fr 90px 90px 90px;
  border-bottom: 1px solid var(--line);
}

.employee-row:last-child {
  border-bottom: 0;
}

.employee-row > span {
  padding: 10px;
  border-left: 1px solid var(--line);
}

@media (max-width: 820px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding: 18px 0;
  }

  .topbar,
  .results-heading,
  .result-total-row,
  .inline-field,
  .comment-row {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions,
  .form-actions {
    justify-content: stretch;
  }

  .result-row-block {
    grid-template-columns: 1fr;
  }

  .result-row-label {
    justify-content: flex-start;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .modal-backdrop {
    padding: 12px;
  }
}
