:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --text: #102033;
  --muted: #607086;
  --line: #dce4ee;
  --accent: #0f9f9a;
  --accent-dark: #08736f;
  --navy: #0f1f35;
  --warn: #f5b94f;
  --good: #2a9d68;
  --danger: #d85b5b;
  --shadow: 0 18px 50px rgba(20, 39, 70, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: var(--navy);
  color: white;
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 800;
}

.brand span,
.sidebar-note span {
  display: block;
  color: #b8c6d8;
  font-size: 13px;
  margin-top: 3px;
}

nav {
  display: grid;
  gap: 8px;
}

.nav-button {
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 8px;
  padding: 12px 14px;
  color: #dce7f6;
  background: transparent;
}

.nav-button:hover,
.nav-button.active {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.sidebar-note {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

code {
  color: white;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 4px;
  padding: 1px 5px;
}

.main {
  padding: 28px;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: 30px;
  letter-spacing: 0;
}

h2 {
  font-size: 25px;
  margin-bottom: 10px;
}

h3 {
  font-size: 18px;
  margin-bottom: 12px;
}

p,
li {
  color: var(--muted);
  line-height: 1.6;
}

.user-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 13px;
  background: var(--surface);
  color: var(--muted);
  white-space: nowrap;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hero-panel {
  background: linear-gradient(135deg, #ffffff 0%, #eaf7f6 100%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 8px;
  padding: 34px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: 30px;
  align-items: center;
}

.hero-panel h2 {
  font-size: 40px;
  line-height: 1.08;
  max-width: 760px;
}

.hero-panel p {
  max-width: 680px;
}

.hero-actions,
.dashboard-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.primary,
.secondary,
.tiny-btn {
  border: 0;
  border-radius: 8px;
  padding: 11px 16px;
  font-weight: 700;
}

.primary {
  background: var(--accent);
  color: white;
}

.primary:hover {
  background: var(--accent-dark);
}

.secondary {
  background: #e8edf4;
  color: var(--text);
}

.tiny-btn {
  padding: 7px 10px;
  font-size: 13px;
  background: #eef3f8;
  color: var(--text);
}

.tiny-btn.approve {
  background: #e0f5ec;
  color: #14784d;
}

.tiny-btn.reject {
  background: #fde8e8;
  color: #a63f3f;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.stats-grid div,
.info-panel,
.form-panel,
.today-panel,
.lesson-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stats-grid div {
  padding: 18px;
}

.stats-grid strong {
  display: block;
  font-size: 30px;
  color: var(--navy);
}

.stats-grid span {
  color: var(--muted);
  font-size: 13px;
}

.section-grid,
.admin-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.info-panel,
.form-panel,
.today-panel {
  padding: 22px;
}

.form-panel {
  max-width: 680px;
  box-shadow: var(--shadow);
}

form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: white;
  color: var(--text);
}

textarea {
  resize: vertical;
}

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

.hidden {
  display: none !important;
}

.dashboard-header {
  justify-content: space-between;
  margin-bottom: 18px;
}

.list {
  display: grid;
  gap: 12px;
}

.person-row,
.submission-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 10px;
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  background: #eef3f8;
}

.pill.pending {
  background: #fff1ce;
  color: #8a5f00;
}

.pill.approved,
.pill.pass {
  background: #e0f5ec;
  color: #14784d;
}

.pill.rejected,
.pill.fail {
  background: #fde8e8;
  color: #a63f3f;
}

.training-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  align-items: start;
}

.lesson-area {
  min-width: 0;
}

.progress-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--muted);
}

.progress-bar {
  height: 10px;
  border-radius: 999px;
  background: #e7edf5;
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
}

.week-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.week-tabs button {
  border: 1px solid var(--line);
  background: white;
  color: var(--muted);
  border-radius: 8px;
  padding: 9px 12px;
  font-weight: 700;
}

.week-tabs button.active {
  background: var(--navy);
  color: white;
  border-color: var(--navy);
}

.lesson-list {
  display: grid;
  gap: 12px;
}

.lesson-card {
  padding: 18px;
  display: grid;
  gap: 12px;
}

.lesson-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.lesson-title {
  display: grid;
  gap: 3px;
}

.lesson-title strong {
  font-size: 18px;
}

.lesson-title span {
  color: var(--muted);
  font-size: 13px;
}

.lesson-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.lesson-actions a {
  text-decoration: none;
}

.qa-list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 20px;
}

.today-panel {
  position: sticky;
  top: 20px;
}

@media (max-width: 980px) {
  .app-shell,
  .hero-panel,
  .section-grid,
  .admin-columns,
  .training-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .today-panel {
    position: static;
  }
}

@media (max-width: 680px) {
  .main {
    padding: 18px;
  }

  .sidebar {
    padding: 20px;
  }

  .hero-panel {
    padding: 22px;
  }

  .hero-panel h2 {
    font-size: 30px;
  }

  .topbar,
  .lesson-top {
    flex-direction: column;
    align-items: stretch;
  }
}
