* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #F7F7F5; color: #2C2C2A;
  margin: 0; padding: 0; line-height: 1.5;
}
.site-header {
  background: #0C447C;
  color: white;
  padding: 16px 24px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
.site-logo {
  width: 70px;
  height: 70px;
  background: white;
  border-radius: 50%;
  padding: 4px;
  flex-shrink: 0;
  object-fit: contain;
}
.site-header-text {
  text-align: center;
  flex: 0 1 auto;
}
.site-title {
  margin: 0;
  font-size: 22px;
  font-weight: 500;
  color: white;
  letter-spacing: 0.5px;
}
.site-subtitle {
  margin: 4px 0 0;
  font-size: 14px;
  color: #B5D4F4;
  font-weight: 400;
}
.site-subtitle a {
  color: #B5D4F4;
  text-decoration: none;
  border-bottom: 1px dotted rgba(181, 212, 244, 0.5);
  transition: color 0.15s, border-color 0.15s;
}
.site-subtitle a:hover {
  color: white;
  border-bottom-color: white;
}
.container { max-width: 1000px; margin: 0 auto; padding: 0 20px 20px; }
h1, h2, h3, h4 { font-weight: 500; margin: 0 0 12px; }
input, select, textarea, button {
  font-family: inherit; font-size: 14px;
  padding: 8px 12px; border: 1px solid #D3D1C7;
  border-radius: 8px; background: white; color: #2C2C2A;
}
input[type="text"], input[type="password"], select, textarea { width: 100%; }
textarea { resize: vertical; font-family: inherit; min-height: 40px; }
button { cursor: pointer; background: white; transition: background 0.15s; }
button:hover:not(:disabled) { background: #F1EFE8; }
button:disabled { opacity: 0.6; cursor: not-allowed; }
button.primary { background: #185FA5; color: white; border-color: #185FA5; }
button.primary:hover:not(:disabled) { background: #0C447C; }
button.danger { color: #A32D2D; }
.card { background: white; border: 1px solid #E5E3DC; border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: #F1EFE8; border-radius: 8px; padding: 16px; }
.stat-label { font-size: 13px; color: #5F5E5A; margin-bottom: 4px; }
.stat-value { font-size: 24px; font-weight: 500; }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs button.active { background: #F1EFE8; font-weight: 500; }
.row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid #E5E3DC; gap: 12px; }
.row:last-child { border-bottom: none; }
.user-name { font-weight: 500; font-size: 14px; margin: 0; }
.user-meta { font-size: 12px; color: #5F5E5A; margin: 0; }
.badge { display: inline-block; padding: 4px 12px; border-radius: 8px; font-size: 13px; font-weight: 500; }
.badge-lg { padding: 6px 16px; font-size: 16px; }
.badge-NE { background: #F1EFE8; color: #444441; }
.badge-N  { background: #FCEBEB; color: #791F1F; }
.badge-E  { background: #FAEEDA; color: #633806; }
.badge-A  { background: #EAF3DE; color: #27500A; }
.login-box { max-width: 420px; margin: 60px auto; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-bottom: 12px; }
.form-row label { display: block; font-size: 12px; color: #5F5E5A; margin-bottom: 4px; }
.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid #E5E3DC; flex-wrap: wrap; gap: 10px; }
.user-pill { display: flex; align-items: center; gap: 12px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 500; font-size: 14px; }
.av-admin { background: #EEEDFE; color: #3C3489; }
.av-monitor { background: #E1F5EE; color: #085041; }
.av-student { background: #E6F1FB; color: #0C447C; }
.progress-bar { height: 10px; background: #F1EFE8; border-radius: 5px; overflow: hidden; display: flex; }
.pb-A { background: #27500A; }
.pb-E { background: #BA7517; }
.pb-N { background: #A32D2D; }
.level-buttons { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.level-btn { padding: 5px 12px; font-size: 12px; font-weight: 500; }
.level-btn.active-NE { background: #F1EFE8; color: #444441; border-color: #444441; }
.level-btn.active-N  { background: #FCEBEB; color: #791F1F; border-color: #791F1F; }
.level-btn.active-E  { background: #FAEEDA; color: #633806; border-color: #633806; }
.level-btn.active-A  { background: #EAF3DE; color: #27500A; border-color: #27500A; }
.student-card { background: white; border: 1px solid #E5E3DC; border-radius: 12px; padding: 16px; margin-bottom: 10px; cursor: pointer; }
.student-card:hover { background: #FAFAF7; }
.info-banner { background: #E6F1FB; color: #0C447C; padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; }
.legend { font-size: 12px; color: #5F5E5A; padding: 12px; background: #F1EFE8; border-radius: 8px; margin-top: 16px; }
.legend .badge { margin: 0 4px; }
.muted { color: #888780; }
.comment { font-style: italic; color: #5F5E5A; margin: 6px 0 0; font-size: 13px; }
.date-meta { font-size: 11px; color: #888780; margin: 4px 0 0; }
h3.section-title { font-size: 16px; margin-bottom: 12px; }
h4.module-title { font-size: 15px; margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.module-block {
  border: 1px solid #E5E3DC;
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: hidden;
}
.module-header {
  padding: 14px 16px;
  background: #FAFAF7;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.module-body { padding: 0 16px 8px; }
.submodule-row { padding: 12px 0; border-top: 1px solid #F1EFE8; }
.submodule-row:first-child { border-top: none; }
.submodule-name { font-weight: 500; font-size: 14px; margin: 0 0 8px; }
.save-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: start; }
.eval-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.comment-input {
  flex: 1;
  min-width: 180px;
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid #D3D1C7;
  border-radius: 8px;
}
.save-comment-btn {
  padding: 6px 10px;
  font-size: 16px;
  background: white;
  border: 1px solid #D3D1C7;
  border-radius: 8px;
  cursor: pointer;
  line-height: 1;
}
.save-comment-btn:hover { background: #E6F1FB; border-color: #185FA5; }
.save-status {
  font-size: 12px;
  color: #27500A;
  min-width: 20px;
}
.error-msg { color: #A32D2D; font-size: 13px; }
.pwd-wrap { position: relative; }
.pwd-wrap input { padding-right: 42px; }
.pwd-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  padding: 6px 10px;
  font-size: 16px;
  cursor: pointer;
  color: #888780;
  line-height: 1;
}
.pwd-toggle:hover { background: #F1EFE8; border-radius: 6px; }
.pwd-toggle.active { color: #185FA5; }
.install-btn {
  display: none;
  width: 100%;
  padding: 14px 16px;
  margin-top: 16px;
  background: #378ADD;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.install-btn:hover { background: #185FA5; }
.install-btn.show { display: flex; align-items: center; justify-content: center; gap: 8px; }
.install-hint { font-size: 12px; color: #5F5E5A; text-align: center; margin-top: 10px; display: none; }
.install-hint.show { display: block; }
.ios-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6); z-index: 99999;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.ios-dialog {
  background: white; border-radius: 12px; padding: 24px;
  max-width: 380px; width: 100%;
}
.ios-step {
  display: flex; gap: 12px; margin: 16px 0;
  padding: 12px; background: #F7F7F5; border-radius: 8px;
}
.ios-step-num {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
  background: #378ADD; color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 500; font-size: 14px;
}
.ios-step-text { font-size: 14px; line-height: 1.5; }
.ios-step-text strong { color: #0C447C; }
.collapse-toggle { cursor: pointer; user-select: none; font-size: 12px; color: #5F5E5A; }
.sub-list { padding: 10px 0; }
.sub-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; border-bottom: 1px solid #F1EFE8; gap: 8px;
}
.sub-item:last-child { border-bottom: none; }
.add-sub-form { display: flex; gap: 8px; margin-top: 10px; }
@media (max-width: 500px) {
  .container { padding: 0 10px 10px; }
  .card { padding: 14px; }
  .site-header {
    padding: 12px 12px;
    gap: 10px;
  }
  .site-logo {
    width: 44px;
    height: 44px;
    padding: 2px;
  }
  .site-title { font-size: 15px; }
  .site-subtitle { font-size: 12px; }
}
