* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: #2e2a24;
  color: #d8cdb8;
font-family: 'Times New Roman', Times, serif;
  min-height: 100vh;
  display: block;
}

body.login-page {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 80px 20px 40px;
}

.auth-container {
  background-color: #f0ebe0;
  border: 1px solid #c0b09a;
  border-radius: 3px;
  padding: 52px 44px;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: auto;
}

.auth-container h1 {
  color: #2e2018;
  font-weight: normal;
}

.auth-container .subtitle {
  color: #7a6a50;
}

.auth-container label {
  color: #6a5a40;
}

.auth-container input[type="email"],
.auth-container input[type="password"],
.auth-container input[type="text"] {
  background-color: #faf8f4;
  border: 1px solid #c0b09a;
  color: #2e2018;
}

.auth-container input:focus {
  border-color: #8a7a5a;
  outline: none;
}

.auth-container button[type="submit"] {
  background-color: #5a5040;
  color: #f0ebe0;
  border: 1px solid #6a6050;
  letter-spacing: 0.05em;
}

.auth-container button[type="submit"]:hover {
  background-color: #6a6050;
  border-color: #7a7060;
}

.auth-container .switch-link {
  color: #8a7a5a;
}

.auth-container .switch-link:hover {
  color: #2e2018;
}

.auth-container .toggle-password {
  color: #8a7a5a !important;
}

.student-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 40px 20px;
}

:root { --role-accent: #c8b888; }
.sidebar {
  width: 224px;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  background-color: #282420;
  border-right: 1px solid #3a3530;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-header {
  padding: 36px 24px 28px;
  border-bottom: 1px solid #3a3530;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-role {
  color: #9a8a6a;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sidebar-email {
  color: #6a6050;
  font-size: 0.74rem;
  word-break: break-all;
}

.sidebar-nav {
  flex: 1;
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.nav-btn {
  width: 100%;
  text-align: left;
  padding: 13px 24px;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  font-family: 'Times New Roman', Times, serif;
  font-size: 0.87rem;
  cursor: pointer;
  color: #8a8070;
  transition: color 0.12s, background 0.12s;
}

.nav-btn-active {
  color: #b0a888;
}

.nav-btn-active:hover {
  background-color: #343028;
  color: #d8cdb8;
}

.nav-btn-current {
  background-color: #343028;
  border-left: 3px solid var(--role-accent, #c8b888);
  color: #d8cdb8;
}

.nav-btn-disabled {
  color: #4a4538;
  cursor: not-allowed;
}

.nav-btn-disabled:hover {
  background: none;
}

.sidebar-footer {
  padding: 20px 24px;
  border-top: 1px solid #3a3530;
}

.main-content {
  margin-left: 224px;
  width: calc(100% - 224px);
  min-height: 100vh;
  padding: 44px 52px;
  overflow-y: auto;
  overflow-x: auto;
  background-color: #2e2a24;
}

.module-panel {
  display: flex;
  flex-direction: column;
  gap: 28px;
  width: 100%;
  min-height: calc(100vh - 88px);
}

.coming-soon {
  color: #5a5040;
  font-size: 0.95rem;
  padding: 48px 0;
}

h1 {
  font-size: 1.35rem;
  color: #c8b888;
  letter-spacing: 0.02em;
  font-weight: normal;
}

h2 {
  font-size: 1.2rem;
  color: #c8b888;
  margin-bottom: 4px;
  letter-spacing: 0.01em;
  font-weight: normal;
}

h3 {
  font-size: 0.82rem;
  color: #9a8a6a;
  margin-bottom: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: normal;
}

.subtitle {
  color: #9a9080;
  font-size: 0.88rem;
}

input[type="email"],
input[type="password"],
input[type="text"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 10px 14px;
  background-color: #242018;
  border: 1px solid #4a4538;
  border-radius: 2px;
  color: #d8cdb8;
  font-size: 0.93rem;
font-family: 'Times New Roman', Times, serif;
}

input[type="email"]:focus,
input[type="password"]:focus,
input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #7a7060;
}

textarea {
  resize: vertical;
}

select {
  cursor: pointer;
}

label {
  font-size: 0.87rem;
  color: #9a9080;
  margin-bottom: 4px;
  display: block;
}

button[type="submit"] {
  width: 100%;
  padding: 11px;
  background-color: #5a5040;
  color: #e8e0cc;
  border: 1px solid #6a6050;
  border-radius: 2px;
  font-size: 0.93rem;
font-family: 'Times New Roman', Times, serif;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: background 0.12s, border-color 0.12s;
}

button[type="submit"]:hover {
  background-color: #6a6050;
  border-color: #7a7060;
}

button[type="button"] {
  width: auto;
  padding: 8px 20px;
  background-color: #4a4538;
  color: #d8cdb8;
  border: 1px solid #5a5548;
  border-radius: 2px;
  font-size: 0.88rem;
font-family: 'Times New Roman', Times, serif;
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: 0.02em;
  transition: background 0.12s, border-color 0.12s;
}

button[type="button"]:hover {
  background-color: #5a5548;
  border-color: #7a7060;
  color: #f0e8d0;
}

button[type="button"]:disabled {
  background-color: #242018;
  color: #4a4538;
  border-color: #343028;
  cursor: not-allowed;
}

.delete-btn {
  width: auto;
  padding: 4px 12px;
  background-color: #3a2828;
  color: #b89090;
  border: 1px solid #5a3838;
  font-size: 0.82rem;
}

.delete-btn:hover {
  background-color: #4a3030;
  border-color: #7a4848;
  color: #d0a8a8;
}


.modal-box {
  background-color: #2a2418;
  border: 1px solid #5a5040;
}


.modal-title {
  color: #c8b888;
}

#status-message,
#config-status,
#table-status {
  font-size: 0.88rem;
  min-height: 20px;
  color: #9a9080;
}

.config-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  max-width: 540px;
}

.config-form button[type="button"] {
  width: fit-content;
}


.config-form {
  border: 1px solid #3a3530;
  border-radius: 3px;
  padding: 20px 24px;
  background-color: rgba(0,0,0,0.08);
}

.form-row {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.form-row label {
  width: 140px;
  flex-shrink: 0;
  padding-top: 10px;
  margin-bottom: 0;
}

.form-row > input,
.form-row > select,
.form-row > textarea {
  flex: 1;
}

.form-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 8px;
}

#choices-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.config-table-wrap {
  display: block;
  overflow-x: auto;
  margin-top: 8px;
}


.config-table-wrap {
  border-top: 1px solid #3a3530;
  padding-top: 16px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
  min-width: 600px;
}

.data-table th {
  text-align: left;
  padding: 12px 16px;
  background-color: #242018;
  border-bottom: 2px solid #4a4538;
  color: #9a8a6a;
  font-weight: normal;
  white-space: nowrap;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.76rem;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #3a3530;
  vertical-align: middle;
  color: #c8c0a8;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background-color: #343028;
}

.section-header-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0 8px;
  border-top: 1px solid #4a4538;
  margin-top: 8px;
}

.section-header-row:first-child {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.toolbar input[type="text"] {
  width: 240px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 0 8px;
  margin-top: auto;
  border-top: 1px solid #3a3530;
  background-color: #2e2a24;
  position: sticky;
  bottom: 0;
}

.pagination button {
  padding: 6px 16px;
}

.pagination-info {
  color: #9a9080;
  font-size: 0.87rem;
  padding: 6px 12px;
  border: 1px solid #4a4538;
  border-radius: 2px;
}

.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrapper input {
  flex: 1;
  padding-right: 40px;
}

.toggle-password {
  position: absolute;
  right: 10px;
  background: none !important;
  border: none !important;
  color: #7a7060 !important;
  cursor: pointer;
  font-size: 1rem;
  width: auto !important;
  padding: 0 !important;
  min-width: unset;
}

.toggle-password:hover {
  color: #a09880 !important;
}

.switch-link {
  text-align: center;
  color: #7a7868;
  font-size: 0.84rem;
  text-decoration: none;
}

.switch-link:hover {
  color: #c8b888;
}

.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 1px solid #4a4538;
  margin-bottom: 28px;
}

.tab-btn {
  width: auto;
  padding: 9px 18px;
  background-color: transparent;
  color: #6a6858;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 2px 2px 0 0;
  font-size: 0.87rem;
  cursor: pointer;
  margin-bottom: -1px;
font-family: 'Times New Roman', Times, serif;
  transition: color 0.12s;
}

.tab-btn:hover {
  color: #d8cdb8;
}

.tab-btn-active {
  background-color: transparent;
  border: none;
  border-bottom: 3px solid #c8b888 !important;
  color: #c8b888;
}

.tab-bar button[type="button"] {
  width: auto;
  padding: 9px 18px;
  background-color: transparent;
  color: #6a6858;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 2px 2px 0 0;
  font-size: 0.87rem;
  margin-bottom: -1px;
font-family: 'Times New Roman', Times, serif;
  transition: color 0.12s;
}

.tab-bar button[type="button"]:hover {
  background-color: transparent;
  color: #d8cdb8;
  border-color: transparent;
}

.tab-bar .tab-btn-active {
  background-color: transparent;
  border: none;
  border-bottom: 3px solid #c8b888 !important;
  color: #c8b888;
}

.notice-banner {
  background-color: #242018;
  color: #9a9080;
  text-align: center;
  padding: 7px 12px;
  font-size: 0.82rem;
  border-bottom: 1px solid #3a3530;
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 999;
  letter-spacing: 0.04em;
}

form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.gender-select {
  display: flex;
  gap: 28px;
  padding: 4px 0;
}

.gender-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #6a6050;
  font-size: 0.93rem;
  cursor: pointer;
}

.gender-radio input[type="radio"] {
  width: auto;
  margin: 0;
  accent-color: #7a7060;
}

#questions-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
}

#questions-table th {
  text-align: left;
  padding: 12px 16px;
  background-color: #242018;
  border-bottom: 2px solid #4a4538;
  color: #9a8a6a;
  font-weight: normal;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.76rem;
}

#questions-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #3a3530;
  vertical-align: middle;
  color: #c8c0a8;
}

#questions-table tr:last-child td {
  border-bottom: none;
}

input[type="date"] {
  background-color: #2e2a24;
  color: #d8cdb8;
  border: 1px solid #4a4538;
  border-radius: 2px;
  padding: 6px 10px;
  font-family: 'Times New Roman', Times, serif;
  font-size: 0.87rem;
  cursor: pointer;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.7) sepia(0.3) hue-rotate(10deg);
  cursor: pointer;
}

input[type="date"]:focus {
  outline: none;
  border-color: #c8b888;
}

@media (max-width: 1200px) {
  .sidebar { width: 180px; }
  .main-content { margin-left: 180px; width: calc(100% - 180px); padding: 32px 28px; }
  .toolbar input[type="text"] { width: 180px; }
}

@media (max-width: 900px) {
  .toolbar { flex-wrap: wrap; gap: 8px; }
  .module-panel { gap: 20px; }
  .main-content { padding: 24px 18px; }
  .config-form { max-width: 100%; }
}

.toggle-password svg {
  width: 18px;
  height: 18px;
  display: block;
}

.toggle-password {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  width: 24px !important;
}

.admin-door{
  position:fixed;
  right:18px;
  bottom:18px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:34px;
  height:34px;
  border-radius:4px;
  color:#6a6858;
  opacity:0.55;
  text-decoration:none;
  transition:opacity 0.15s ease, color 0.15s ease;
}
.admin-door:hover,.admin-door:focus-visible{
  opacity:1;
  color:#c8b888;
  outline:none;
}
.admin-door:focus-visible{
  box-shadow:0 0 0 2px #c8b888;
}

.auth-container button:not(.toggle-password) {
  width: fit-content !important;
  padding-left: 32px;
  padding-right: 32px;
  align-self: center;
  margin-left: auto;
  margin-right: auto;
  display: block;
}