:root {
  --red: #8f1c22;
  --red2: #b62b2d;
  --gold: #d8a43a;
  --ink: #242120;
  --muted: #77716c;
  --paper: #f5f2ed;
  --line: #e5dfd6;
  --white: #fff;
  --green: #287854;
  --shadow: 0 10px 35px rgba(72, 48, 31, 0.09);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: "Be Vietnam Pro", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
button,
input,
textarea,
select {
  font: inherit;
}
.hidden {
  display: none !important;
}
.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  background: #f9f7f2;
}
.login-art {
  position: relative;
  overflow: hidden;
  padding: 7vw;
  background:
    radial-gradient(
      circle at 85% 20%,
      rgba(230, 183, 76, 0.35),
      transparent 25%
    ),
    linear-gradient(145deg, #711018, #a52527);
  color: white;
  display: flex;
  align-items: center;
}
.login-art:after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
    30deg,
    transparent 48%,
    rgba(255, 255, 255, 0.035) 49%,
    rgba(255, 255, 255, 0.035) 51%,
    transparent 52%
  );
  background-size: 40px 40px;
}
.star {
  position: absolute;
  top: 8%;
  right: 12%;
  font-size: 12rem;
  color: #e9b842;
  opacity: 0.22;
}
.login-copy {
  position: relative;
  z-index: 1;
  max-width: 640px;
}
.eyebrow {
  letter-spacing: 0.25em;
  font-size: 0.8rem;
  font-weight: 700;
  color: #f1ce77;
}
.login-copy h1 {
  font-family: "Be Vietnam Pro", "Segoe UI", Arial, sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(3rem, 6vw, 6.4rem);
  line-height: 0.96;
  margin: 20px 0 28px;
  letter-spacing: -0.03em;
}
.login-copy h1 em {
  font-style: normal;
  color: #efc564;
}
.login-copy p {
  max-width: 530px;
  line-height: 1.8;
  opacity: 0.84;
}
.landmark {
  position: absolute;
  bottom: -10px;
  left: 5%;
  right: 5%;
  height: 26%;
  opacity: 0.14;
  background: linear-gradient(
      150deg,
      transparent 40%,
      #fff 41% 54%,
      transparent 55%
    )
    bottom/32% 100% repeat-x;
}
.login-panel {
  display: grid;
  place-items: center;
  padding: 48px;
}
.login-form {
  width: min(420px, 100%);
}
.brand-mark {
  width: 58px;
  height: 58px;
  background: var(--red);
  color: #f4ca68;
  display: grid;
  place-items: center;
  border-radius: 16px;
  font-size: 1.8rem;
  box-shadow: 0 10px 25px rgba(143, 28, 34, 0.25);
}
.login-form h2 {
  font-size: 2rem;
  margin: 30px 0 8px;
}
.login-form > p {
  color: var(--muted);
  margin: 0 0 34px;
}
.login-form label,
.form-group label {
  display: grid;
  gap: 9px;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0 0 20px;
}
.login-form input,
.form-control {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  padding: 13px 15px;
  outline: 0;
  transition: 0.2s;
}
.login-form input:focus,
.form-control:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(143, 28, 34, 0.1);
}
.btn {
  border: 0;
  border-radius: 9px;
  padding: 11px 18px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.18s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn-primary {
  background: var(--red);
  color: #fff;
}
.btn-secondary {
  background: #eee9e2;
  color: #4f4843;
}
.btn-danger {
  background: #fceaea;
  color: #a21f26;
}
.btn-block {
  width: 100%;
  padding: 14px;
}
.login-form small {
  display: block;
  text-align: center;
  color: #999;
  margin-top: 25px;
}
.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}
.sidebar {
  position: fixed;
  width: 260px;
  inset: 0 auto 0 0;
  background: #71151b;
  color: white;
  padding: 25px 17px;
  display: flex;
  flex-direction: column;
  z-index: 20;
  box-shadow: 5px 0 24px rgba(70, 14, 17, 0.12);
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 3px 10px 28px;
}
.brand-icon {
  width: 43px;
  height: 43px;
  border: 1px solid rgba(240, 196, 92, 0.55);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #eec45b;
  font-size: 1.25rem;
}
.brand strong,
.brand span {
  display: block;
}
.brand strong {
  font-family: "Be Vietnam Pro", "Segoe UI", Arial, sans-serif;
  font-weight: 800;
  letter-spacing: 0.05em;
}
.brand span {
  font-size: 0.67rem;
  letter-spacing: 0.12em;
  color: #e8c465;
  margin-top: 3px;
}
.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.nav-heading {
  font-size: 0.63rem;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.42);
  margin: 22px 13px 8px;
}
.nav-link {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  text-align: left;
  padding: 12px 14px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 0.88rem;
}
.nav-link i {
  width: 21px;
  font-style: normal;
  text-align: center;
  font-size: 1.05rem;
}
.nav-link:hover,
.nav-link.active {
  background: rgba(255, 255, 255, 0.11);
  color: white;
}
.nav-link.active {
  box-shadow: inset 3px 0 #eac15e;
}
.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 19px 10px 0;
  display: flex;
  gap: 10px;
  align-items: center;
}
.sidebar-footer strong,
.sidebar-footer small {
  display: block;
  font-size: 0.68rem;
}
.sidebar-footer small {
  opacity: 0.46;
  margin-top: 3px;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #58cf89;
  box-shadow: 0 0 0 4px rgba(88, 207, 137, 0.12);
}
.main {
  grid-column: 2;
  min-width: 0;
}
.topbar {
  height: 90px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 0 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar > div:first-of-type {
  flex: 1;
}
.topbar span {
  font-size: 0.61rem;
  letter-spacing: 0.13em;
  color: #a49d96;
}
.topbar h2 {
  font-family: "Be Vietnam Pro", "Segoe UI", Arial, sans-serif;
  font-weight: 700;
  margin: 4px 0 0;
  font-size: 1.45rem;
}
.top-actions,
.user {
  display: flex;
  align-items: center;
  gap: 12px;
}
.user small,
.user strong {
  display: block;
  font-size: 0.74rem;
}
.user small {
  color: #98918b;
  margin-top: 3px;
}
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f1e0c0;
  color: #7e5318;
  display: grid;
  place-items: center;
  font-weight: 800;
}
.icon-button {
  border: 0;
  background: transparent;
  font-size: 1.2rem;
  cursor: pointer;
  color: #716a65;
  padding: 10px;
}
.content {
  padding: 30px 34px 60px;
  max-width: 1500px;
  margin: auto;
}
.hero {
  background: linear-gradient(110deg, #851a20, #b83231);
  border-radius: 15px;
  padding: 27px 30px;
  color: #fff;
  position: relative;
  overflow: hidden;
  margin-bottom: 25px;
}
.hero:after {
  content: "★";
  position: absolute;
  right: 4%;
  top: -45px;
  font-size: 11rem;
  color: rgba(255, 255, 255, 0.08);
}
.hero h3 {
  font-family: "Be Vietnam Pro", "Segoe UI", Arial, sans-serif;
  font-weight: 700;
  font-size: 1.55rem;
  margin: 0 0 8px;
}
.hero p {
  font-size: 0.8rem;
  opacity: 0.75;
  margin: 0;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin: 22px 0;
}
.stat-card,
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.stat-card {
  padding: 20px;
}
.stat-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #f4e9d3;
  color: #96691b;
  display: grid;
  place-items: center;
  font-weight: 800;
}
.stat-card b {
  display: block;
  font-family: "Be Vietnam Pro", "Segoe UI", Arial, sans-serif;
  font-weight: 800;
  font-size: 1.8rem;
  margin: 15px 0 5px;
}
.stat-card span {
  color: var(--muted);
  font-size: 0.72rem;
}
.panel {
  padding: 21px;
  margin-top: 18px;
}
.panel-header,
.page-actions,
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.panel-header {
  margin-bottom: 18px;
}
.panel h3 {
  font-family: "Be Vietnam Pro", "Segoe UI", Arial, sans-serif;
  font-weight: 700;
  margin: 0;
  font-size: 1.15rem;
}
.panel-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.73rem;
}
.table-wrap {
  overflow: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}
.data-table th {
  text-align: left;
  padding: 11px 12px;
  color: #968d85;
  font-size: 0.63rem;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table td {
  padding: 14px 12px;
  border-bottom: 1px solid #eeeae5;
  vertical-align: middle;
}
.data-table tr:last-child td {
  border: 0;
}
.data-table tbody tr:hover {
  background: #fbf9f6;
}
.muted {
  color: var(--muted);
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 20px;
  font-size: 0.64rem;
  font-weight: 700;
  background: #eee;
}
.badge.active,
.badge.finished {
  background: #e3f4e9;
  color: #27764d;
}
.badge.inactive,
.badge.abandoned {
  background: #f2efec;
  color: #746b65;
}
.badge.started {
  background: #fff1cf;
  color: #8a6115;
}
.actions {
  display: flex;
  gap: 5px;
}
.action {
  border: 0;
  background: #f4f0eb;
  border-radius: 7px;
  padding: 7px 9px;
  cursor: pointer;
  color: #655d57;
}
.action:hover {
  background: #e8ded4;
  color: var(--red);
}
.page-actions {
  margin-bottom: 20px;
}
.toolbar {
  flex-wrap: wrap;
}
.search {
  min-width: 250px;
}
.empty {
  text-align: center;
  padding: 50px 20px;
  color: var(--muted);
}
.pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 16px;
}
.pagination button {
  border: 1px solid var(--line);
  background: white;
  border-radius: 6px;
  padding: 7px 11px;
  cursor: pointer;
}
.pagination button.active {
  background: var(--red);
  color: white;
}
.pagination button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}
.page-gap {
  padding: 0 4px;
  color: var(--muted);
}
.page-summary {
  margin-right: 8px;
  color: var(--muted);
  font-size: 0.72rem;
}
.rank {
  color: var(--red);
}
.rank.rank-top {
  color: #9a6912;
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 20, 16, 0.55);
  backdrop-filter: blur(3px);
}
.modal-card {
  position: relative;
  background: white;
  border-radius: 14px;
  padding: 29px;
  width: min(720px, 96vw);
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
}
.modal-close {
  position: absolute;
  right: 15px;
  top: 12px;
  border: 0;
  background: transparent;
  font-size: 1.7rem;
  cursor: pointer;
  color: #999;
}
.modal h2 {
  font-family: "Be Vietnam Pro", "Segoe UI", Arial, sans-serif;
  font-weight: 700;
  margin: 0 0 6px;
}
.modal .subtitle {
  color: var(--muted);
  font-size: 0.78rem;
  margin: 0 0 25px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 18px;
}
.form-group.full {
  grid-column: 1/-1;
}
.form-group textarea {
  min-height: 90px;
  resize: vertical;
}
.check {
  display: flex !important;
  grid-auto-flow: column;
  justify-content: start;
  align-items: center;
  gap: 9px !important;
}
.check input {
  width: auto;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 7px;
}
.answer-grid {
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: start;
  gap: 9px;
  margin-bottom: 9px;
}
.answer-letter {
  height: 42px;
  border-radius: 8px;
  background: #f2e6ce;
  color: #865a19;
  display: grid;
  place-items: center;
  font-weight: 800;
}
.toast {
  position: fixed;
  right: 25px;
  top: 24px;
  z-index: 200;
  background: #252220;
  color: #fff;
  padding: 13px 18px;
  border-radius: 9px;
  box-shadow: var(--shadow);
  font-size: 0.78rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: 0.25s;
}
.toast.show {
  opacity: 1;
  transform: none;
}
.toast.error {
  background: #a42328;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.detail-item {
  background: #f8f5f1;
  border-radius: 9px;
  padding: 13px;
}
.detail-item small,
.detail-item strong {
  display: block;
}
.detail-item small {
  color: var(--muted);
  font-size: 0.66rem;
  margin-bottom: 6px;
}
.mobile-only {
  display: none;
}
.session-filter {
  display: grid;
  grid-template-columns:
    minmax(220px, 1.35fr) minmax(180px, 1fr) minmax(190px, 0.9fr)
    minmax(170px, 0.8fr) auto auto;
  gap: 12px;
  align-items: end;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 17px 18px;
  box-shadow: var(--shadow);
}
.filter-field {
  display: grid;
  gap: 7px;
}
.filter-field label {
  font-size: 0.68rem;
  font-weight: 700;
  color: #746d67;
}
.session-filter .form-control {
  min-width: 0;
}
.status-legend {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.file-input {
  padding: 9px;
  background: #faf8f5;
}
.file-input::file-selector-button {
  border: 0;
  border-radius: 7px;
  background: #eee5da;
  color: #5c4a3c;
  padding: 8px 12px;
  margin-right: 10px;
  font-weight: 700;
  cursor: pointer;
}
.current-audio {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
}
.current-audio audio {
  height: 32px;
  max-width: 320px;
}
.vbee-quick,
.smart-guide,
.settings-test {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 17px;
  margin-bottom: 20px;
  border: 1px solid #ead8ad;
  border-radius: 10px;
  background: #fff8e8;
}
.vbee-quick strong,
.vbee-quick small,
.smart-guide strong,
.smart-guide span {
  display: block;
}
.vbee-quick small,
.smart-guide span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
}
.smart-input-label {
  display: grid;
  gap: 9px;
  font-size: 0.85rem;
  font-weight: 600;
}
.smart-textarea {
  min-height: 300px;
  resize: vertical;
  line-height: 1.65;
}
.smart-options {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}
.smart-options label {
  margin: 0;
}
.smart-preview {
  max-height: 330px;
  overflow: auto;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 9px;
  background: #faf8f5;
  font-size: 0.78rem;
}
.smart-preview-item {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.smart-preview-item:last-child {
  border-bottom: 0;
}
.smart-preview-item ol {
  margin: 9px 0;
  padding-left: 30px;
}
.smart-preview-item li.correct {
  color: var(--green);
  font-weight: 700;
}
.validation-error {
  color: #a42328;
  font-weight: 700;
}
.settings-panel {
  max-width: 950px;
  margin: 0 auto;
}
.inline-field {
  display: flex;
  gap: 9px;
}
.inline-field .form-control {
  flex: 1;
}
.settings-test {
  align-items: end;
  background: #f8f5f1;
  border-color: var(--line);
}
.settings-test label {
  display: grid;
  flex: 1;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
}
.settings-test audio {
  height: 38px;
}
.smart-guide code {
  padding: 2px 5px;
  border-radius: 4px;
  background: #eee5da;
}
.badge.difficulty-easy {
  background: #e7f5eb;
  color: #27764d;
}
.badge.difficulty-medium {
  background: #fff1cf;
  color: #8a6115;
}
.badge.difficulty-hard {
  background: #fbe4e4;
  color: #9b2026;
}
@media (max-width: 1200px) {
  .session-filter {
    grid-template-columns: 1fr 1fr 1fr 1fr;
  }
  .session-filter .btn {
    width: 100%;
  }
}
@media (max-width: 1050px) {
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .app {
    grid-template-columns: 220px 1fr;
  }
  .sidebar {
    width: 220px;
  }
  .login-screen {
    grid-template-columns: 1fr;
  }
  .login-art {
    display: none;
  }
  .session-filter {
    grid-template-columns: 1fr 1fr;
  }
  .session-filter .btn {
    width: 100%;
  }
}
@media (max-width: 750px) {
  .sidebar {
    transform: translateX(-100%);
    transition: 0.25s;
  }
  .sidebar.open {
    transform: none;
  }
  .app {
    display: block;
  }
  .main {
    grid-column: auto;
  }
  .topbar {
    padding: 0 15px;
    height: 76px;
  }
  .content {
    padding: 20px 15px;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .top-actions .user div:last-child {
    display: none;
  }
  .form-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .form-group.full {
    grid-column: auto;
  }
  .login-panel {
    padding: 25px;
  }
  .mobile-only {
    display: block;
  }
  .search {
    min-width: 100%;
    width: 100%;
  }
  .session-filter {
    grid-template-columns: 1fr;
  }
  .status-legend {
    display: none;
  }
  .page-summary {
    width: 100%;
    margin: 0 0 4px;
    text-align: right;
  }
  .vbee-quick,
  .smart-guide,
  .settings-test,
  .inline-field {
    align-items: stretch;
    flex-direction: column;
  }
}
@media (max-width: 430px) {
  .stats {
    grid-template-columns: 1fr;
  }
  .page-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .btn {
    width: 100%;
  }
}
