* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Arial, Helvetica, sans-serif;
  color: #1f2933;
  background: #ffffff;
}

.intranet-page {
  min-height: 100vh;
  border-bottom: 32px solid #17242c;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(to bottom, transparent calc(100vh - 64px), #e6edf2 calc(100vh - 64px), #e6edf2 calc(100vh - 32px)) border-box;
}

.intranet-shell {
  width: 100%;
  min-height: calc(100vh - 32px);
  padding-top: 44px;
}

.brand-header {
  text-align: center;
}

.brand-logo {
  display: block;
  width: 283px;
  height: auto;
  margin: 0 auto 8px;
}

.brand-header h1 {
  margin: 0;
  color: #66717f;
  font-size: 23px;
  line-height: 1.25;
  font-weight: 700;
}

.login-form {
  width: 350px;
  margin: 57px auto 0;
  color: #0f1720;
}

.login-form label {
  display: block;
  margin: 0 0 10px;
  font-size: 16px;
  line-height: 1;
  color: #0b0f14;
}

.login-form input {
  display: block;
  width: 100%;
  height: 38px;
  margin: 0 0 20px;
  padding: 8px 12px;
  border: 1px solid #c9d0d7;
  border-radius: 4px;
  color: #28323f;
  background: #ffffff;
  font-size: 16px;
  line-height: 20px;
  outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.login-form input::placeholder {
  color: #697789;
}

.login-form input:focus {
  border-color: #66afe9;
  box-shadow: 0 0 0 3px rgba(102, 175, 233, 0.18);
}

.login-form button,
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid #006fe6;
  border-radius: 4px;
  color: #ffffff;
  background: #007bff;
  font-size: 16px;
  line-height: 20px;
  text-decoration: none;
  cursor: pointer;
}

.login-form button:hover,
.link-button:hover {
  background: #0069d9;
}

.dashboard-page,
.education-page {
  min-height: 100vh;
  background: #f5f7fa;
}

.admin-shell,
.education-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 48px;
}

.admin-header,
.education-panel,
.panel,
.metric {
  border: 1px solid #d8e0e7;
  border-radius: 8px;
  background: #ffffff;
}

.admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  margin-bottom: 18px;
}

.admin-header h1,
.education-panel h1,
.panel h2 {
  margin: 0 0 8px;
  color: #17242c;
}

.admin-header p,
.education-panel p {
  margin: 0 0 12px;
  color: #5b6775;
}

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

.metrics-grid.wide {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.metric {
  padding: 18px;
}

.metric span {
  display: block;
  color: #5b6775;
  font-size: 14px;
}

.metric strong {
  display: block;
  margin-top: 6px;
  color: #17242c;
  font-size: 28px;
}

.panel {
  padding: 20px;
  margin-bottom: 18px;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.link-button.secondary {
  border-color: #c7d2dd;
  color: #17242c;
  background: #ffffff;
}

.link-button.secondary:hover {
  background: #eef3f7;
}

.link-button.danger {
  border-color: #b42318;
  background: #b42318;
}

.funnel-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.funnel-grid div {
  min-height: 94px;
  padding: 16px;
  border: 1px solid #d8e0e7;
  border-radius: 8px;
  background: #f8fafc;
}

.funnel-grid span,
.funnel-grid small {
  display: block;
  color: #5b6775;
}

.funnel-grid strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 28px;
  color: #17242c;
}

.panel pre {
  overflow: auto;
  padding: 14px;
  border-radius: 6px;
  background: #17242c;
  color: #edf4f7;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid #e3e8ee;
  text-align: left;
  vertical-align: top;
}

th {
  color: #3b4652;
  background: #f1f4f7;
  font-weight: 700;
}

code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
}

.ua {
  max-width: 360px;
  word-break: break-word;
}

.education-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
}

.education-panel {
  width: min(680px, 100%);
  padding: 34px;
  text-align: left;
}

.education-logo {
  display: block;
  width: 240px;
  margin: 0 auto 18px;
}

.education-panel h1,
.education-panel p {
  text-align: center;
}

.education-list {
  width: min(520px, 100%);
  margin: 20px auto;
  color: #303b47;
  line-height: 1.7;
}

.login-shell,
.invalid-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.dashboard-login,
.invalid-panel {
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid #d8e0e7;
  border-radius: 8px;
  background: #ffffff;
}

.dashboard-login h1,
.invalid-panel h1 {
  margin: 0 0 8px;
}

.dashboard-login p,
.invalid-panel p {
  margin: 0 0 18px;
  color: #5b6775;
}

.dashboard-login label,
.dashboard-login input,
.dashboard-login button {
  display: block;
  width: 100%;
}

.dashboard-login label {
  margin-bottom: 8px;
}

.dashboard-login input {
  height: 40px;
  margin-bottom: 14px;
  padding: 8px 10px;
  border: 1px solid #c9d0d7;
  border-radius: 4px;
}

.dashboard-login button {
  min-height: 40px;
  border: 1px solid #006fe6;
  border-radius: 4px;
  color: #ffffff;
  background: #007bff;
  cursor: pointer;
}

.form-error {
  margin-bottom: 14px;
  padding: 10px;
  border-radius: 6px;
  color: #8a1f11;
  background: #fde8e4;
}

@media (max-width: 640px) {
  .intranet-shell {
    padding-top: 34px;
  }

  .brand-logo {
    width: 238px;
  }

  .brand-header h1 {
    padding: 0 20px;
    font-size: 20px;
  }

  .login-form {
    width: min(350px, calc(100% - 48px));
    margin-top: 46px;
  }

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

  .metrics-grid.wide,
  .funnel-grid {
    grid-template-columns: 1fr;
  }

  .admin-header {
    display: block;
  }

  .admin-actions {
    justify-content: flex-start;
    margin-top: 16px;
  }
}
