html {
  font-size: 15px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

body {
  margin: 0;
  color: #132037;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 184, 107, 0.28), transparent 32%),
    radial-gradient(circle at 88% 5%, rgba(107, 196, 255, 0.25), transparent 36%),
    linear-gradient(165deg, #f8fafc 0%, #ebf5ff 40%, #ffffff 100%);
  min-height: 100vh;
}

.top-user-bar {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.45rem 0.7rem 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.65rem;
  color: #304863;
  font-size: 0.83rem;
}

.top-user-bar form {
  display: flex;
  align-items: center;
  margin: 0;
}

.top-user-bar .secondary-link,
.top-user-bar .logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0.2rem 0.55rem;
  border-radius: 8px;
  line-height: 1;
}

.top-user-bar .form-select,
.top-user-bar .form-select-sm {
  min-height: 34px;
  padding-top: 0.2rem;
  padding-bottom: 0.2rem;
}

.logout-btn {
  border: 0;
  background: transparent;
}

.assessment-shell {
  --status-green: #2f8f46;
  --status-yellow: #d39e00;
  --status-red: #c0392b;
  max-width: 1180px;
  margin: 0.8rem auto 1.4rem;
  padding: 0.7rem;
}

.auth-shell {
  max-width: 680px;
}

.auth-shell .assessment-header,
.auth-shell .request-panel {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

.assessment-header {
  margin-bottom: 0.7rem;
  border-radius: 16px;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(19, 32, 55, 0.1);
  backdrop-filter: blur(2px);
  box-shadow: 0 10px 24px rgba(29, 52, 82, 0.08);
}

.assessment-header h1 {
  margin: 0;
  font-size: 1.55rem;
}

.assessment-header p {
  margin: 0.3rem 0 0;
  color: #516078;
}

.header-actions {
  margin-top: 0.45rem;
}

.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.45rem;
}

.meta-line span {
  border-radius: 999px;
  background: #eff6ff;
  color: #183355;
  padding: 0.18rem 0.55rem;
  font-size: 0.84rem;
}

.primary-btn {
  display: inline-block;
  border: 1px solid #2b71ba;
  background: #2f7cc9;
  color: #ffffff;
  text-decoration: none;
  border-radius: 8px;
  padding: 0.38rem 0.75rem;
  font-weight: 600;
}

.primary-btn:hover {
  background: #2368ad;
  color: #ffffff;
}

.complete-btn {
  border-color: #1f7a3d;
  background: #2f8f46;
}

.complete-btn:hover {
  background: #246f36;
}

.secondary-link {
  color: #254869;
  text-decoration: none;
  font-weight: 600;
}

.inline-action-form {
  display: inline;
  margin-left: 0.75rem;
}

.delete-link {
  border: 0;
  background: transparent;
  padding: 0;
}

.request-panel {
  max-width: 860px;
}

.request-form {
  display: grid;
  gap: 0.65rem;
}

.request-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.field-group {
  display: grid;
  gap: 0.25rem;
}

.field-group span:first-child {
  font-weight: 600;
  color: #1a324f;
}

.text-input {
  border: 1px solid #c7d7ea;
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
}

.request-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.action-note {
  margin: 0.4rem 0 0;
  font-size: 0.82rem;
  color: #4e617c;
}

.text-danger {
  font-size: 0.8rem;
}

.sheet-list {
  display: grid;
  gap: 1rem;
}

.worksheet-panel {
  border-radius: 14px;
  border: 1px solid rgba(19, 32, 55, 0.12);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 20px rgba(19, 32, 55, 0.06);
  padding: 0.75rem;
}

.worksheet-panel h2 {
  margin: 0 0 0.55rem;
  font-size: 1.1rem;
  color: #183355;
}

.analytics-shell {
  display: grid;
  gap: 0.75rem;
}

.analytics-grid {
  display: grid;
  gap: 0.75rem;
}

.overview-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.analytics-card {
  border-radius: 14px;
  border: 1px solid rgba(19, 32, 55, 0.12);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 20px rgba(19, 32, 55, 0.06);
  padding: 0.75rem;
}

.analytics-card-wide {
  grid-column: 1 / -1;
}

.analytics-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.analytics-card-header h2 {
  margin: 0;
  font-size: 1.02rem;
  color: #183355;
}

.analytics-card-header span {
  color: #5a6d87;
  font-size: 0.82rem;
}

.stat-card {
  display: grid;
  gap: 0.18rem;
}

.accent-card {
  background: linear-gradient(180deg, rgba(237, 246, 255, 0.96), rgba(255, 255, 255, 0.94));
}

.analytics-label {
  color: #5a6d87;
  font-size: 0.82rem;
}

.analytics-value {
  color: #10253f;
  font-size: 1.6rem;
  line-height: 1.1;
}

.analytics-list {
  display: grid;
  gap: 0.55rem;
}

.compact-list {
  gap: 0.45rem;
}

.analytics-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 240px);
  align-items: center;
  gap: 0.75rem;
}

.analytics-row strong {
  display: block;
  color: #14304e;
  font-size: 0.93rem;
}

.analytics-row span {
  color: #5a6d87;
  font-size: 0.8rem;
}

.analytics-meter-wrap {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.analytics-meter {
  position: relative;
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: #e9f0f7;
  overflow: hidden;
}

.analytics-meter span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #68a9dc, #2f7cc9);
}

.analytics-row-value {
  min-width: 58px;
  text-align: right;
  color: #14304e;
  font-weight: 600;
}

.analytics-table th:last-child,
.analytics-table td:last-child {
  text-align: right;
}

.section-panel {
  border: 1px solid rgba(19, 32, 55, 0.14);
  border-radius: 10px;
  margin-bottom: 0.45rem;
  background: #ffffff;
  overflow: hidden;
}

.section-panel:last-child {
  margin-bottom: 0;
}

.section-panel summary {
  cursor: pointer;
  padding: 0.55rem 0.7rem;
  background: linear-gradient(90deg, #f0f6ff, #f8fbff);
  color: #10253f;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.section-title {
  font-weight: 600;
}

.section-average {
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.85rem;
  color: #0f2a47;
  background: #dbeeff;
}

.section-panel.status-green summary {
  background: linear-gradient(90deg, color-mix(in srgb, var(--status-green) 14%, white), #f8fbff);
}

.section-panel.status-yellow summary {
  background: linear-gradient(90deg, color-mix(in srgb, var(--status-yellow) 18%, white), #fffaf0);
}

.section-panel.status-red summary {
  background: linear-gradient(90deg, color-mix(in srgb, var(--status-red) 14%, white), #fff5f5);
}

.section-panel.status-green .section-average {
  background: color-mix(in srgb, var(--status-green) 20%, white);
  color: #164523;
}

.section-panel.status-yellow .section-average {
  background: color-mix(in srgb, var(--status-yellow) 25%, white);
  color: #6c4e00;
}

.section-panel.status-red .section-average {
  background: color-mix(in srgb, var(--status-red) 22%, white);
  color: #6b1f16;
}

.section-panel summary::-webkit-details-marker {
  display: none;
}

.section-panel[open] summary {
  border-bottom: 1px solid rgba(19, 32, 55, 0.1);
}

.section-table {
  width: 100%;
  border-collapse: collapse;
}

.section-table thead th {
  background: #f7fafd;
  border-top: 1px solid #edf2f8;
  border-bottom: 1px solid #edf2f8;
  text-align: left;
  padding: 0.38rem 0.5rem;
  font-size: 0.85rem;
  color: #304863;
}

.section-table td {
  border-top: 1px solid #edf2f8;
  padding: 0.38rem 0.5rem;
  vertical-align: middle;
  white-space: normal;
  line-height: 1.35;
}

.section-table td:nth-child(1),
.section-table td:nth-child(2) {
  padding-top: 0.48rem;
  padding-bottom: 0.48rem;
}

.grade-cell {
  width: 120px;
  white-space: nowrap;
  text-align: center;
}

.grade-input {
  width: 72px;
  border: 1px solid #c8d5e6;
  border-radius: 8px;
  padding: 0.28rem 0.4rem;
}

.percentage-cell {
  width: 110px;
  font-weight: 600;
  white-space: nowrap;
  text-align: center;
}

.empty-state {
  margin: 0;
  padding: 0.55rem 0.7rem;
  color: #5d6f86;
}

@media (max-width: 768px) {
  .assessment-shell {
    margin-top: 0.35rem;
    padding: 0.5rem;
  }

  .assessment-header {
    padding: 0.75rem;
  }

  .request-grid {
    grid-template-columns: 1fr;
  }

  .overview-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .analytics-row {
    grid-template-columns: 1fr;
  }

  .analytics-table th:last-child,
  .analytics-table td:last-child {
    text-align: left;
  }
}