﻿:root {
  --bg: #f6f8fc;
  --card: #ffffff;
  --primary: #154a9c;
  --primary-strong: #0f3a7d;
  --accent: #f59e0b;
  --text: #162235;
  --muted: #54637c;
  --line: #dbe3f1;
  --danger: #dc2626;
  --danger-strong: #b91c1c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  background: #ffffff;
  color: var(--text);
  border-bottom: 1px solid var(--line);
  padding: 18px 24px;
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
  color: var(--primary);
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
}

.topbar a {
  color: var(--primary);
  text-decoration: none;
}

.topbar a:hover {
  color: var(--primary-strong);
  text-decoration: underline;
}

.container {
  width: min(1120px, 92%);
  margin: 34px auto 40px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 20px;
  margin: 0 auto;
}

.logo {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 16px;
}

.site-nav a,
.text-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}

.site-nav a:hover,
.text-link:hover {
  color: var(--primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.lang-switch select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 13px;
  background: #fff;
  color: var(--text);
}

.menu-toggle {
  display: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  padding: 10px 16px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-strong);
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(21, 74, 156, 0.12);
  padding: 18px;
  margin-bottom: 18px;
}

.card h2,
.card h3 {
  margin-top: 0;
  margin-bottom: 12px;
}

.card h2 {
  font-size: clamp(24px, 3vw, 32px);
}

.card h3 {
  font-size: 22px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.one-line-summary {
  margin-top: 0;
  margin-bottom: 10px;
}

.card.auth-collapsed #authCardContent {
  display: none;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text);
  background: #fff;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #a8c0f3;
  box-shadow: 0 0 0 3px rgba(21, 74, 156, 0.12);
}

textarea {
  resize: vertical;
}

button {
  margin-top: 12px;
  border: 0;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  padding: 9px 14px;
  font-size: 14px;
  cursor: pointer;
}

button:hover {
  background: var(--primary-strong);
}

button.secondary {
  background: #f4f7ff;
  border: 1px solid var(--line);
  color: var(--text);
}

button.secondary:hover {
  background: #e8effd;
}

button.mini {
  margin: 0;
  padding: 6px 10px;
  font-size: 12px;
}

button + button {
  margin-left: 12px;
}

button.danger {
  background: var(--danger);
}

button.danger:hover {
  background: var(--danger-strong);
}

.list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
}

.list li {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fff;
}

.tutor-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.student-subtitle {
  margin-top: -4px;
}

.student-filter-bar {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 12px;
  margin: 10px 0;
}

.student-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.tutor-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  background: #fff;
}

.tutor-card.selected {
  border: 2px solid #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.16);
}

.tutor-main {
  display: flex;
  gap: 14px;
}

.tutor-main h4 {
  margin: 0 0 4px;
  font-size: 22px;
}

.tutor-avatar {
  width: 96px;
  height: 96px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #e5e7eb;
}

.tutor-side {
  min-width: 130px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
}

.price {
  font-weight: 700;
  font-size: 28px;
  color: var(--primary-strong);
}

.tutor-price-note {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.muted-line {
  color: var(--muted);
  font-size: 14px;
  margin-top: 2px;
}

.tag-row {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-chip {
  font-size: 12px;
  background: #eef2ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  padding: 2px 8px;
}

.tutor-empty {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 16px;
  color: var(--muted);
}

.result {
  margin-top: 12px;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  min-height: 70px;
  white-space: pre-wrap;
  word-break: break-word;
}

.checkout-sub {
  color: var(--muted);
  margin-top: -2px;
}

.checkout-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  margin-bottom: 10px;
}

.checkout-block strong {
  color: var(--primary-strong);
}

.checkout-block p {
  margin: 8px 0 0;
  color: var(--muted);
}

.checkout-total {
  margin-top: 10px !important;
  color: var(--primary) !important;
  font-weight: 800;
  font-size: 30px;
}

.checkout-agree {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
  color: var(--muted);
  font-size: 14px;
}

.checkout-agree input {
  width: 16px;
  height: 16px;
}

.muted {
  color: var(--muted);
  margin-top: 10px;
}

.status-success {
  color: #166534;
}

.status-error {
  color: #b91c1c;
}

.status-pending {
  color: var(--primary);
}

.hidden {
  display: none;
}

.avatar-preview {
  width: 120px;
  height: 120px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--line);
  margin-top: 10px;
  background: #e5e7eb;
}

.slot-select {
  margin-top: 6px;
  min-height: 220px;
}

.admin-table-wrap {
  margin-top: 12px;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 960px;
}

.admin-table th,
.admin-table td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}

.admin-table th {
  background: #f4f7ff;
  color: #334155;
}

.admin-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-empty {
  color: var(--muted);
  text-align: center !important;
  padding: 18px !important;
}

.role-badge,
.review-badge {
  display: inline-block;
  border-radius: 999px;
  font-size: 12px;
  padding: 2px 8px;
  border: 1px solid transparent;
}

.role-admin {
  background: #fee2e2;
  border-color: #fecaca;
  color: #991b1b;
}

.role-teacher {
  background: #dbeafe;
  border-color: #bfdbfe;
  color: #1e3a8a;
}

.role-student {
  background: #dcfce7;
  border-color: #bbf7d0;
  color: #166534;
}

.review-approved {
  background: #dcfce7;
  border-color: #bbf7d0;
  color: #166534;
}

.review-rejected {
  background: #fee2e2;
  border-color: #fecaca;
  color: #991b1b;
}

.review-pending {
  background: #ffedd5;
  border-color: #fed7aa;
  color: #9a3412;
}

@media (max-width: 900px) {
  .student-filter-bar {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .student-filter-bar {
    grid-template-columns: 1fr;
  }

  .menu-toggle {
    display: block;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 12px 4%;
    flex-direction: column;
  }

  .site-nav.open {
    display: flex;
  }

  .nav-actions .text-link {
    display: none;
  }

  .lang-switch span {
    display: none;
  }

  .tutor-card {
    flex-direction: column;
  }

  .tutor-side {
    align-items: flex-start;
  }
}
