:root {
  --ink: #16212f;
  --muted: #657386;
  --line: #d9e1ea;
  --panel: #ffffff;
  --page: #f4f7f6;
  --brand: #007a5e;
  --brand-dark: #075640;
  --accent: #f3b23c;
  --danger: #b7282e;
  --soft-green: #e9f5ef;
  --soft-yellow: #fff5dd;
  --shadow: 0 18px 55px rgba(28, 49, 72, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(0, 122, 94, 0.08), transparent 34%),
    linear-gradient(315deg, rgba(243, 178, 60, 0.12), transparent 30%),
    var(--page);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  color: #ffffff;
  background: var(--brand);
  font-weight: 750;
  cursor: pointer;
  transition:
    transform 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

button:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 122, 94, 0.22);
}

button.secondary {
  color: var(--ink);
  background: #edf2f1;
}

button.secondary:hover {
  color: var(--ink);
  background: #dde7e5;
  box-shadow: none;
}

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

.home-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.home-shell {
  width: min(1060px, 100%);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  align-items: stretch;
}

.brand-panel,
.portal-card,
.panel,
.stats-row article {
  border: 1px solid rgba(217, 225, 234, 0.86);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.brand-panel {
  min-height: 560px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 8px;
  padding: clamp(28px, 6vw, 58px);
  overflow: hidden;
  position: relative;
}

.brand-panel::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -100px;
  width: 310px;
  height: 310px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.22), transparent),
    repeating-linear-gradient(45deg, var(--accent) 0 18px, var(--ink) 18px 36px);
  transform: rotate(-8deg);
  opacity: 0.22;
}

.brand-logo-wrap {
  width: min(360px, 100%);
  min-height: 86px;
  display: flex;
  align-items: center;
  border-radius: 8px;
}

.brand-logo {
  width: 100%;
  max-width: 360px;
  height: auto;
  display: block;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 14px;
  font-size: clamp(2.4rem, 7vw, 5.3rem);
  line-height: 0.94;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 7px;
  font-size: 1.18rem;
}

.lead,
.page-title p,
.panel-heading p,
.portal-card small {
  color: var(--muted);
  line-height: 1.55;
}

.lead {
  max-width: 560px;
  font-size: clamp(1rem, 2vw, 1.22rem);
}

.portal-grid {
  display: grid;
  gap: 18px;
}

.portal-card {
  min-height: 210px;
  display: flex;
  align-items: center;
  gap: 20px;
  border-radius: 8px;
  padding: 28px;
}

.portal-card:hover {
  border-color: rgba(0, 122, 94, 0.36);
  transform: translateY(-2px);
}

.portal-icon {
  flex: 0 0 78px;
  height: 78px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--brand-dark);
  background: var(--soft-green);
  font-size: 0.88rem;
  font-weight: 900;
}

.employee-card .portal-icon {
  color: #7c5100;
  background: var(--soft-yellow);
}

.portal-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.portal-card small {
  display: block;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 14px clamp(18px, 4vw, 42px);
  border-bottom: 1px solid rgba(217, 225, 234, 0.8);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
}

.mini-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.mini-brand img {
  width: 104px;
  height: auto;
  display: block;
  flex: 0 0 auto;
}

.mini-brand strong {
  white-space: nowrap;
}

.top-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.top-nav a,
.top-nav button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  color: var(--muted);
  background: #ffffff;
  font-size: 0.92rem;
  font-weight: 750;
  box-shadow: none;
}

.top-nav button:hover {
  color: var(--ink);
  background: #edf2f1;
  transform: none;
  box-shadow: none;
}

.app-shell {
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: clamp(22px, 4vw, 42px);
}

.page-title {
  max-width: 760px;
  margin-bottom: 24px;
}

.page-title h1 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 5vw, 3.9rem);
  line-height: 1;
}

.auth-shell {
  min-height: calc(100vh - 120px);
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 34px) 0;
}

.auth-panel {
  width: min(480px, 100%);
}

.auth-logo {
  width: min(190px, 72vw);
  height: auto;
  display: block;
  margin-bottom: 14px;
}

.auth-panel h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 8vw, 3rem);
  line-height: 1;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.stats-row article,
.panel {
  border-radius: 8px;
}

.stats-row article {
  padding: 18px;
}

.stats-row span {
  display: block;
  font-size: 2rem;
  font-weight: 900;
}

.stats-row small {
  color: var(--muted);
  font-weight: 750;
}

.dashboard-panel {
  margin-bottom: 22px;
}

.dashboard-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.dashboard-heading strong {
  max-width: 340px;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--brand-dark);
  background: var(--soft-green);
  font-size: 0.9rem;
  line-height: 1.35;
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.dashboard-metrics article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f9fbfb;
}

.dashboard-metrics span {
  display: block;
  min-height: 30px;
  font-size: 1.45rem;
  font-weight: 900;
}

.dashboard-metrics small {
  color: var(--muted);
  font-weight: 750;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.summary-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
}

.summary-block h3 {
  margin: 0 0 12px;
  font-size: 0.95rem;
}

.bar-list {
  display: grid;
  gap: 10px;
}

.bar-item {
  display: grid;
  gap: 6px;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #334155;
  font-size: 0.86rem;
  font-weight: 780;
}

.bar-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9eef2;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
}

.activity-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.activity-list li {
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  color: #334155;
  font-size: 0.88rem;
  line-height: 1.4;
}

.activity-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.activity-list small {
  display: block;
  color: var(--muted);
}

.module-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.smart-card {
  min-height: 174px;
  display: grid;
  align-content: start;
  gap: 10px;
  border: 1px solid rgba(217, 225, 234, 0.86);
  border-radius: 8px;
  padding: 18px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  text-align: left;
  box-shadow: var(--shadow);
}

.smart-card:hover {
  border-color: rgba(0, 122, 94, 0.38);
  background: #ffffff;
}

.smart-card span {
  width: max-content;
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--brand-dark);
  background: var(--soft-green);
  font-size: 0.78rem;
  font-weight: 850;
}

.smart-card strong {
  display: block;
  font-size: 1.25rem;
}

.smart-card small {
  color: var(--muted);
  line-height: 1.5;
}

.module-window {
  width: min(1120px, calc(100vw - 28px));
  max-height: min(860px, calc(100vh - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
}

.module-window::backdrop {
  background: rgba(22, 33, 47, 0.55);
  backdrop-filter: blur(4px);
}

.window-panel {
  max-height: min(860px, calc(100vh - 28px));
  overflow: auto;
  box-shadow: 0 24px 80px rgba(22, 33, 47, 0.28);
}

.window-heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.icon-close {
  flex: 0 0 auto;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
  gap: 22px;
  align-items: start;
  margin-bottom: 22px;
}

.panel {
  padding: clamp(18px, 3vw, 26px);
}

.panel-heading {
  margin-bottom: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.full-span {
  grid-column: 1 / -1;
}

.helper-note {
  border: 1px solid rgba(0, 122, 94, 0.18);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
  color: var(--brand-dark);
  background: var(--soft-green);
  font-size: 0.9rem;
  line-height: 1.45;
}

label {
  display: grid;
  gap: 7px;
  color: #2b3a4a;
  font-size: 0.9rem;
  font-weight: 780;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: #ffffff;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0, 122, 94, 0.13);
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.module-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin: -4px 0 18px;
}

.file-action {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 18px;
  color: #ffffff;
  background: var(--brand);
  font-weight: 750;
  cursor: pointer;
}

.file-action:hover {
  background: var(--brand-dark);
}

.file-action input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: #334155;
  background: #f7faf9;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

td {
  color: #273445;
  font-size: 0.93rem;
}

.row-actions {
  display: flex;
  gap: 8px;
}

.row-actions button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.82rem;
}

.side-stack {
  display: grid;
  gap: 22px;
}

.manager-block {
  display: grid;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.manager-block:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pill-list li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 6px 4px 12px;
  background: #f9fbfb;
  font-size: 0.88rem;
  font-weight: 740;
}

.pill-list button {
  width: 24px;
  min-height: 24px;
  border-radius: 999px;
  padding: 0;
  background: #eef3f2;
  color: var(--danger);
  box-shadow: none;
}

.employee-shell {
  width: min(940px, 100%);
}

.employee-layout {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 22px;
  align-items: start;
}

.login-panel,
.observation-panel,
.tests-panel,
.test-attempt-panel {
  display: grid;
  gap: 16px;
}

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

.test-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f9fbfb;
}

.test-card header,
.report-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.status-pill {
  width: max-content;
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--brand-dark);
  background: var(--soft-green);
  font-size: 0.78rem;
  font-weight: 850;
}

.status-pill.pending {
  color: #7c5100;
  background: var(--soft-yellow);
}

.status-pill.failed {
  color: var(--danger);
  background: #fde7e8;
}

.question-list {
  display: grid;
  gap: 16px;
}

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

.option-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.option-list label {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f9fbfb;
  font-weight: 650;
}

.option-list input {
  width: auto;
  min-height: auto;
}

.report-card {
  border-color: rgba(0, 122, 94, 0.22);
}

.report-score {
  font-size: 2rem;
  font-weight: 900;
}

.employee-badge {
  border: 1px solid rgba(0, 122, 94, 0.18);
  border-radius: 8px;
  padding: 14px;
  color: var(--brand-dark);
  background: var(--soft-green);
  line-height: 1.45;
  font-weight: 780;
}

.employee-badge small {
  display: block;
  color: #4d655d;
  font-weight: 650;
}

.hidden {
  display: none !important;
}

.empty-state {
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 36px));
  border-radius: 8px;
  padding: 13px 16px;
  color: #ffffff;
  background: var(--ink);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 920px) {
  .home-shell,
  .admin-layout,
  .employee-layout {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    min-height: 420px;
  }

  .stats-row,
  .module-card-grid,
  .dashboard-metrics,
  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-heading {
    flex-direction: column;
  }

  .app-shell {
    padding: 22px;
  }
}

@media (max-width: 620px) {
  .home-page {
    padding: 16px;
  }

  .portal-card,
  .app-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-nav {
    justify-content: flex-start;
    width: 100%;
  }

  .top-nav a,
  .top-nav button {
    justify-content: center;
    flex: 1 1 135px;
  }

  .mini-brand {
    width: 100%;
    justify-content: space-between;
  }

  .mini-brand img {
    width: 92px;
  }

  .mini-brand strong {
    white-space: normal;
    text-align: right;
  }

  .app-shell {
    padding: 16px;
  }

  .panel,
  .stats-row article,
  .dashboard-metrics article,
  .summary-block {
    padding: 14px;
  }

  .form-grid,
  .inline-form,
  .stats-row,
  .module-card-grid,
  .dashboard-metrics,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .smart-card {
    min-height: 140px;
  }

  .module-window {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }

  .window-panel {
    max-height: calc(100vh - 20px);
  }

  .window-heading {
    flex-direction: column;
  }

  .icon-close {
    width: 100%;
  }

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

  .form-actions button,
  .module-toolbar button,
  .file-action,
  .inline-form button {
    width: 100%;
  }
}
