/* =========================
   WolfClan-Academy UI System
   ========================= */

:root {
  --bg: #0b0f14;
  --border: #1e2d42;
  --text: #e8eef7;
  --muted: #8a97ac;

  --primary: #7c3aed;
  --primary-rgb: 124, 58, 237;
  --primary2: #8b5cf6;
  --primary-glow: rgba(124, 58, 237, .18);

  --shadow: 0 20px 60px rgba(0, 0, 0, .35);
  --radius: 16px;

  --sidebar-w: 264px;
  --sidebar-w-collapsed: 76px;

  --focus: 0 0 0 3px rgba(124, 58, 237, .25);

  --surf-1: rgba(15, 20, 29, 0.95);
  --surf-2: rgba(18, 24, 38, 0.6);
  --surf-3: rgba(14, 20, 28, 0.85);
  --surf-input: rgba(15, 20, 29, 0.65);
}

.theme-middle {
  --bg: #1f1f1f;
  --border: #333333;
  --text: #ffffff;
  --muted: #a1a1aa;

  --primary: #7a1a36;
  --primary-rgb: 122, 26, 54;
  --primary2: #9b2246;
  --primary-glow: rgba(122, 26, 54, 0.18);

  --focus: 0 0 0 3px rgba(122, 26, 54, 0.25);

  --surf-1: rgba(31, 31, 31, 0.95);
  --surf-2: rgba(40, 40, 40, 0.8);
  --surf-3: rgba(31, 31, 31, 0.85);
  --surf-input: rgba(20, 20, 20, 0.65);
}

.theme-light {
  --bg: #f9fafb;
  --border: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;

  --primary: #0ea5e9;
  --primary-rgb: 14, 165, 233;
  --primary2: #0284c7;
  --primary-glow: rgba(14, 165, 233, 0.18);

  --focus: 0 0 0 3px rgba(14, 165, 233, 0.25);

  --surf-1: rgba(255, 255, 255, 0.95);
  --surf-2: rgba(255, 255, 255, 0.8);
  --surf-3: rgba(255, 255, 255, 0.85);
  --surf-input: rgba(255, 255, 255, 0.9);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-size: 14px;
  background: radial-gradient(1200px 600px at 20% 0%, rgba(var(--primary-rgb), .14), transparent 55%),
    radial-gradient(900px 500px at 90% 10%, rgba(34, 197, 94, .08), transparent 60%),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ========== LAYOUT ========== */
.app-shell {
  min-height: 100vh;
  display: flex;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--surf-1);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 12px;
  z-index: 30;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: rgba(11, 15, 20, .4);
}

.topbar {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surf-3);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 20;
}

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

.topbar__menu {
  display: none;
}

.content {
  padding: 26px;
  max-width: 1300px;
  width: 100%;
}

/* Editor takes full space – override .content constraints */
.content:has(.editor-shell) {
  padding: 0;
  max-width: 100%;
}


.footer {
  margin-top: auto;
  padding: 18px 26px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surf-3) 55%, transparent);
}

.footer__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.footer__links {
  display: flex;
  gap: 12px;
}

.footer__links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 800;
  font-size: 13px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid transparent;
}

.footer__links a:hover {
  color: var(--text);
  border-color: rgba(165, 176, 194, .22);
  background: rgba(165, 176, 194, .06);
}

/* Sidebar Overlay (Mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(2px);
  z-index: 25;
}

/* ========== SIDEBAR HEADER (Logo + Toggle) ========== */
.sidebar__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-bottom: 6px;
}

.sidebar__logo {
  width: 120px;
  height: 120px;
  border-radius: 18px;
  border: 1px solid rgba(165, 176, 194, .14);
  background: rgba(255, 255, 255, .02);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.sidebar__logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
}

.sidebar__toggle-mini {
  width: 44px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid rgba(165, 176, 194, .18);
  background: rgba(165, 176, 194, .06);
  color: var(--muted);
  cursor: pointer;
  transition: .18s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.sidebar__toggle-mini:hover {
  background: rgba(165, 176, 194, .10);
  border-color: rgba(165, 176, 194, .26);
  color: var(--text);
}

.toggle-icon {
  position: absolute;
  font-size: 16px;
  line-height: 1;
}

.toggle-icon--collapsed {
  display: block;
}

.toggle-icon--expanded {
  display: none;
}

html.sidebar-collapsed .toggle-icon--collapsed {
  display: block;
}

html.sidebar-collapsed .toggle-icon--expanded {
  display: none;
}

html:not(.sidebar-collapsed) .toggle-icon--collapsed {
  display: none;
}

html:not(.sidebar-collapsed) .toggle-icon--expanded {
  display: block;
}

/* ========== SIDEBAR NAV ========== */
.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid transparent;
  background: transparent;
  transition: .15s ease;
  position: relative;
  font-weight: 600;
}

.nav-item:hover {
  background: rgba(var(--primary-rgb), .08);
  border-color: rgba(var(--primary-rgb), .18);
}

.nav-item:hover .nav-icon i {
  color: rgba(232, 238, 247, 1);
}

.nav-item.active {
  background: rgba(var(--primary-rgb), .14);
  border-color: rgba(var(--primary-rgb), .28);
  box-shadow: inset 3px 0 0 var(--primary);
}

.nav-item.active .nav-icon i {
  color: var(--text);
}

.nav-item.active .nav-label {
  color: var(--text);
}

.nav-item.disabled {
  opacity: .55;
  cursor: not-allowed;
}

.nav-item--logout {
  margin-top: 6px;
  border-color: rgba(239, 68, 68, .18);
}

.nav-item--logout:hover {
  border-color: rgba(239, 68, 68, .35);
  background: rgba(239, 68, 68, .08);
}

/* === Nav Group Labels === */
.nav-group-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: rgba(138, 151, 172, .5);
  padding: 2px 12px;
  margin-bottom: 2px;
}

/* === Topbar Date === */
.topbar-date {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  padding: 6px 14px;
  border-radius: 10px;
  background: var(--surf-input);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.nav-icon {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 26px;
}

.nav-icon i {
  font-size: 15px;
  color: var(--muted);
  transition: color .18s ease;
}

.nav-label {
  font-weight: 700;
  letter-spacing: .1px;
  font-size: 14px;
}

/* Sidebar bottom */
.sidebar__bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 10px;
}

.userchip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surf-2);
  color: var(--text);
  transition: .15s ease;
}

.userchip:hover {
  border-color: rgba(var(--primary-rgb), 0.3);
  background: var(--surf-1);
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--primary-rgb), .10);
  border: 1px solid rgba(var(--primary-rgb), .25);
  color: var(--primary);
  font-weight: 900;
}

.userchip__meta {
  min-width: 0;
}

.userchip__name {
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.userchip__sub {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ========== TOPBAR TEXT ========== */
.page-title {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: .2px;
}

.page-subtitle {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 900;
  letter-spacing: .2px;
  text-decoration: none;
  transition: .18s ease;
  user-select: none;
}

.btn:focus {
  outline: none;
  box-shadow: var(--focus);
}

.btn-full {
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  color: white;
  box-shadow: 0 4px 14px rgba(var(--primary-rgb), 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary2), var(--primary2));
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.5);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-ghost {
  background: rgba(165, 176, 194, .06);
  border-color: rgba(165, 176, 194, .18);
  color: var(--text);
}

.btn-ghost:hover {
  background: rgba(165, 176, 194, .10);
  border-color: rgba(165, 176, 194, .26);
}

.pill {
  border: 1px solid rgba(165, 176, 194, .18);
  background: rgba(165, 176, 194, .06);
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.pill-danger {
  border-color: rgba(239, 68, 68, .25);
  background: rgba(239, 68, 68, .08);
  color: rgba(239, 68, 68, .95);
}

.badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 900;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(165, 176, 194, .18);
  background: rgba(165, 176, 194, .06);
  color: var(--muted);
}

.badge-soon {
  border-color: rgba(245, 158, 11, .25);
  background: rgba(245, 158, 11, .08);
  color: rgba(245, 158, 11, .95);
}

/* ========== FORMS ========== */
label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin: 12px 0 6px;
  font-weight: 800;
}

.input {
  width: 100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: color-mix(in srgb, var(--surf-1) 65%, transparent);
  color: var(--text);
  transition: all .25s ease;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.input:focus {
  outline: none;
  border-color: rgba(var(--primary-rgb), .7);
  background: color-mix(in srgb, var(--surf-2) 90%, transparent);
  box-shadow: 0 0 0 4px rgba(var(--primary-rgb), .15), inset 0 1px 2px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.input-sm {
  padding: 9px 10px;
  border-radius: 12px;
  width: 180px;
}

/* ========== FLASH ========== */
.flash-wrap {
  margin-bottom: 14px;
}

.flash {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surf-2) 75%, transparent);
}

.flash-error {
  border-color: rgba(239, 68, 68, .45);
  color: rgba(239, 68, 68, .95);
}

.flash-success {
  border-color: rgba(34, 197, 94, .35);
  color: rgba(34, 197, 94, .95);
}

.flash-info,
.flash-message {
  border-color: rgba(56, 189, 248, .35);
  color: #38bdf8;
}

.flash-warning {
  border-color: rgba(251, 191, 36, .45);
  color: #fbbf24;
}

/* ========== CARDS / GRID ========== */
.section-title {
  font-weight: 900;
  font-size: 13px;
  letter-spacing: .3px;
  color: var(--muted);
  text-transform: uppercase;
  margin: 0 0 12px 0;
}

.card {
  background: var(--surf-2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  transition: transform .3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow .3s ease, border-color .3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .45), 0 0 0 1px rgba(var(--primary-rgb), 0.1);
  border-color: rgba(var(--primary-rgb), .4);
}

.card.pad {
  padding: 18px;
}

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

/* ===== Dashboard Stat Cards (Kachel-Look) ===== */
.grid.stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1100px) {
  .grid.stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

.stat {
  background: color-mix(in srgb, var(--surf-2) 70%, transparent);
  border: 1px solid rgba(35, 48, 68, .85);
  border-radius: 20px;
  padding: 20px 20px 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, .22), inset 0 1px 0 rgba(255, 255, 255, .04);
  transition: .2s ease;
  position: relative;
  overflow: hidden;
}

.stat::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(var(--primary-rgb), .06) 0%, transparent 60%);
  pointer-events: none;
}

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

.stat__label {
  color: var(--muted);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .4px;
  text-transform: uppercase;
}

.stat__icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(var(--primary-rgb), .2);
  background: rgba(var(--primary-rgb), .12);
  color: var(--primary);
  font-size: 15px;
}

.stat__value {
  font-size: 32px;
  font-weight: 800;
  margin-top: 12px;
  letter-spacing: -.5px;
  line-height: 1;
}

.stat__hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

/* ===== Users page layout ===== */
.users-header h2 {
  margin: 0;
}

.users-sub {
  margin: 6px 0 16px 0;
  color: var(--muted);
}

.users-grid {
  grid-template-columns: 1.35fr .65fr;
  align-items: start;
}

@media (max-width: 1100px) {
  .users-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Tabs ===== */
.tabs {
  display: flex;
  gap: 10px;
  margin: 0 0 14px 0;
}

.tab-btn {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(165, 176, 194, .18);
  background: rgba(165, 176, 194, .06);
  color: var(--muted);
  font-weight: 900;
  cursor: pointer;
  transition: .18s ease;
}

.tab-btn:hover {
  background: rgba(165, 176, 194, .10);
  border-color: rgba(165, 176, 194, .26);
  color: var(--text);
}

.tab-btn.is-active {
  background: rgba(var(--primary-rgb), .25);
  border-color: rgba(var(--primary-rgb), .5);
  color: #fff;
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.25);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 12px;
}

.muted-note {
  color: var(--muted);
  font-size: 12px;
}

.muted {
  color: var(--muted);
}

/* ===== Tables ===== */
.table-wrap {
  overflow: auto;
  border-radius: 14px;
  border: 1px solid var(--border);
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: color-mix(in srgb, var(--surf-1) 35%, transparent);
  color: var(--text);
  min-width: 880px;
}

.table thead th {
  text-align: left;
  font-size: 12px;
  letter-spacing: .3px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surf-2) 55%, transparent);
}

.table td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(30, 45, 66, .7);
  vertical-align: middle;
  transition: background .2s ease, transform .2s ease;
}

.table tbody tr {
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.table tbody tr:hover td {
  background: rgba(var(--primary-rgb), .08);
  color: #fff;
}

.table tbody tr:hover {
  box-shadow: inset 4px 0 0 var(--primary);
}

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

.row-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* ===== Switch ===== */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  user-select: none;
}

.switch input {
  display: none;
}

.switch input[disabled]+.slider {
  opacity: .45;
}

.slider {
  width: 44px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid rgba(165, 176, 194, .22);
  background: rgba(165, 176, 194, .06);
  position: relative;
  transition: .18s ease;
}

.slider::after {
  content: "";
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(232, 238, 247, .85);
  position: absolute;
  top: 2px;
  left: 3px;
  transition: .18s ease;
}

.switch input:checked+.slider {
  border-color: rgba(var(--primary-rgb), .45);
  background: rgba(var(--primary-rgb), .16);
}

.switch input:checked+.slider::after {
  left: 21px;
  background: #fff;
}

.switch-label {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .2px;
  color: var(--muted);
}

/* ===== Hint box ===== */
.hint-box {
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  border: 1px solid rgba(165, 176, 194, .16);
  background: rgba(165, 176, 194, .05);
  padding: 12px 12px;
  border-radius: 14px;
}

/* ===== Tree Split View ===== */
.tree-split {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 14px;
}

@media (max-width: 900px) {
  .tree-split {
    grid-template-columns: 1fr;
  }
}

.tree-panel {
  border: 1px solid rgba(35, 48, 68, .7);
  background: color-mix(in srgb, var(--surf-1) 35%, transparent);
  border-radius: 14px;
  padding: 10px;
  min-height: 420px;
}

.detail-panel {
  min-width: 0;
}

.treeview {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tree-root {
  padding-left: 0;
}

.tree-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: color-mix(in srgb, var(--surf-2) 35%, transparent);
  transition: .15s ease;
}

.tree-row:hover {
  border-color: rgba(var(--primary-rgb), .4);
  background: rgba(var(--primary-rgb), .12);
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.15);
}

.tree-name {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: .2px;
  font-size: 13px;
  flex: 1;
}

.tree-name.is-selected {
  color: rgba(232, 238, 247, 1);
  text-shadow: 0 0 14px rgba(var(--primary-rgb), .4);
}

.tree-toggle.is-hidden {
  visibility: hidden;
}

.tree-children {
  margin-left: 16px;
  padding-left: 16px;
  border-left: 1px solid rgba(var(--primary-rgb), .15);
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}

.tree-children.is-collapsed {
  display: none;
}

.tree-toggle {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 1px solid rgba(165, 176, 194, .15);
  background: rgba(165, 176, 194, .05);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: .15s;
}

.tree-toggle:hover {
  border-color: rgba(var(--primary-rgb), .3);
  background: rgba(var(--primary-rgb), .08);
}

.tree-toggle::before {
  content: '\276F';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(232, 238, 247, .6);
  font-size: 10px;
  font-weight: 900;
  transition: transform .18s ease;
}

.tree-row.is-open>.tree-toggle::before {
  transform: rotate(90deg);
}

/* ===== Detail Card ===== */
.detail-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.detail-avatar {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 1000;
  border: 1px solid rgba(var(--primary-rgb), .25);
  background: rgba(var(--primary-rgb), .12);
}

.detail-name {
  font-weight: 1000;
  font-size: 16px;
}

.detail-sub {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

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

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

.detail-item {
  border: 1px solid rgba(35, 48, 68, .7);
  background: color-mix(in srgb, var(--surf-2) 45%, transparent);
  border-radius: 14px;
  padding: 10px 12px;
}

.detail-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .3px;
}

.detail-value {
  margin-top: 6px;
  font-weight: 950;
}

.detail-form {
  margin-top: 8px;
}

/* ========== SIDEBAR COLLAPSE (DESKTOP) ========== */
html.sidebar-collapsed .sidebar {
  width: var(--sidebar-w-collapsed);
  padding: 16px 10px;
}

html.sidebar-collapsed .sidebar__logo {
  width: 54px;
  height: 54px;
  border-radius: 16px;
}

html.sidebar-collapsed .sidebar__logo img {
  padding: 6px;
}

html.sidebar-collapsed .nav-label,
html.sidebar-collapsed .nav-group-label,
html.sidebar-collapsed .badge {
  display: none;
}

html.sidebar-collapsed .userchip__meta {
  display: none;
}

html.sidebar-collapsed .userchip {
  justify-content: center;
}

html.sidebar-collapsed .nav-item {
  justify-content: center;
  gap: 0;
}

/* ========== AUTH LAYOUT ========== */
.auth-body {
  min-height: 100vh;
}

.auth-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 520px;
  padding: 46px;
  border-radius: 22px;
  background: var(--surf-1);
  border: 1px solid var(--border);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.4);
}

.auth-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.auth-logo {
  width: 120px;
  height: 120px;
  object-fit: contain;
  filter: drop-shadow(0 14px 24px rgba(0, 0, 0, .35));
}

.auth-subtitle {
  margin: 6px 0 20px 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.auth-actions {
  margin-top: 16px;
}

/* ========== MOBILE: OFF-CANVAS SIDEBAR ========== */
@media (max-width: 900px) {
  .topbar__menu {
    display: inline-flex;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    max-width: 86vw;
    width: var(--sidebar-w);
    transform: translateX(-110%);
    transition: transform .22s ease;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
  }

  .content {
    padding: 18px;
    width: 100%;
  }

  html.sidebar-open .sidebar {
    transform: translateX(0);
  }

  html.sidebar-open .sidebar-overlay {
    display: block;
  }

  html.sidebar-collapsed .sidebar {
    width: var(--sidebar-w);
    padding: 16px;
  }
}

.tree-activity {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-left: 8px;
  background: #22c55e;
  display: inline-block;
}

.tree-activity--stale {
  background: #f59e0b;
}

.tree-activity--never {
  background: #ef4444;
}

/* ==========================================================
   EDITOR LAYOUT
   ========================================================== */

.editor-shell {
  display: grid;
  grid-template-columns: 300px 1fr;
  height: calc(100vh - 0px);
  overflow: hidden;
}

.editor-sidebar {
  background: rgba(12, 16, 24, .97);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.editor-sidebar__header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.editor-sidebar__title {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.editor-sidebar__list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.editor-sidebar__footer {
  padding: 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* Module row in sidebar */
.module-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: .15s ease;
  user-select: none;
}

.module-row:hover {
  background: rgba(var(--primary-rgb), .08);
  border-color: rgba(var(--primary-rgb), .18);
}

.module-row.is-active {
  background: rgba(var(--primary-rgb), .16);
  border-color: rgba(var(--primary-rgb), .35);
}

.module-row__drag {
  cursor: grab;
  color: var(--muted);
  font-size: 13px;
  opacity: .55;
  flex-shrink: 0;
}

.module-row__drag:hover {
  opacity: 1;
}

.module-row__icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.module-row__icon--text {
  background: rgba(var(--primary-rgb), .15);
  color: var(--primary2);
}

.module-row__icon--image {
  background: rgba(34, 197, 94, .12);
  color: #4ade80;
}

.module-row__icon--video {
  background: rgba(239, 68, 68, .12);
  color: #f87171;
}

.module-row__icon--quiz {
  background: rgba(245, 158, 11, .12);
  color: #fbbf24;
}

.module-row__title {
  flex: 1;
  min-width: 0;
  font-weight: 800;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.module-row__del {
  opacity: 0;
  transition: .15s;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(239, 68, 68, .8);
  font-size: 13px;
  padding: 4px;
  border-radius: 6px;
}

.module-row:hover .module-row__del {
  opacity: 1;
}

.module-row__del:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, .1);
}

/* Add module buttons */
.add-module-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.add-module-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surf-2) 55%, transparent);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: .15s ease;
}

.add-module-btn:hover {
  border-color: rgba(var(--primary-rgb), .35);
  color: var(--text);
  background: rgba(var(--primary-rgb), .08);
}

/* Editor canvas */
.editor-canvas {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.editor-topbar {
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 14, 22, .85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.editor-topbar__back {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: .15s;
}

.editor-topbar__back:hover {
  border-color: var(--border);
  background: rgba(165, 176, 194, .06);
  color: var(--text);
}

.editor-topbar__title {
  flex: 1;
  font-weight: 900;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.editor-topbar__title:focus {
  outline: none;
}

.editor-topbar__title[contenteditable="true"] {
  border-bottom: 1px dashed rgba(var(--primary-rgb), .5);
  padding-bottom: 2px;
}

.editor-topbar__status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot--draft {
  background: #f59e0b;
}

.status-dot--published {
  background: #22c55e;
}

.editor-panel {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
}

/* Empty state */
.editor-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 14px;
  color: var(--muted);
  text-align: center;
}

.editor-empty i {
  font-size: 48px;
  opacity: .25;
}

.editor-empty p {
  font-size: 14px;
  max-width: 260px;
  line-height: 1.5;
}

/* Module type selector (radio cards) */
.type-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}

.type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 10px;
  border-radius: 14px;
  border: 2px solid transparent;
  background: var(--surf-2);
  cursor: pointer;
  transition: .15s ease;
  text-align: center;
}

.type-card:hover {
  border-color: rgba(var(--primary-rgb), .3);
  background: rgba(var(--primary-rgb), .07);
}

.type-card.is-selected {
  border-color: var(--primary);
  background: rgba(var(--primary-rgb), .15);
}

.type-card__icon {
  font-size: 22px;
}

.type-card__label {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .3px;
  color: var(--muted);
  text-transform: uppercase;
}

/* Rich text area frame */
.richtext-wrap {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  min-height: 340px;
}

/* Upload zone */
.upload-zone {
  border: 2px dashed rgba(var(--primary-rgb), .35);
  border-radius: 16px;
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  transition: .2s ease;
  position: relative;
}

.upload-zone:hover {
  border-color: rgba(var(--primary-rgb), .65);
  background: rgba(var(--primary-rgb), .04);
}

.upload-zone input[type=file] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-zone i {
  font-size: 36px;
  opacity: .4;
  display: block;
  margin-bottom: 10px;
}

.upload-zone__hint {
  font-size: 12px;
  margin-top: 6px;
}

.media-preview {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, .3);
  margin-bottom: 14px;
}

.media-preview img {
  width: 100%;
  display: block;
  max-height: 320px;
  object-fit: contain;
}

.media-preview video {
  width: 100%;
  display: block;
  max-height: 320px;
}

/* Quiz editor */
.quiz-settings {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 12px;
  margin-bottom: 20px;
}

.question-card {
  background: color-mix(in srgb, var(--surf-1) 50%, transparent);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 10px;
  overflow: hidden;
}

.question-card__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
}

.question-card__drag {
  cursor: grab;
  color: var(--muted);
  opacity: .5;
  font-size: 13px;
}

.question-card__drag:hover {
  opacity: 1;
}

.qtype-badge {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .4px;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}

.qtype-badge--single {
  background: rgba(var(--primary-rgb), .15);
  color: var(--primary2);
  border: 1px solid rgba(var(--primary-rgb), .25);
}

.qtype-badge--multiple {
  background: rgba(34, 197, 94, .12);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, .25);
}

.qtype-badge--ordering {
  background: rgba(245, 158, 11, .12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, .25);
}

.question-card__prompt {
  flex: 1;
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.question-card__toggle {
  color: var(--muted);
  font-size: 12px;
  transition: .2s;
}

.question-card.is-open .question-card__toggle {
  transform: rotate(180deg);
}

.question-card__del {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(239, 68, 68, .6);
  font-size: 13px;
  padding: 4px 6px;
  border-radius: 6px;
  transition: .15s;
}

.question-card__del:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, .1);
}

.question-card__body {
  display: none;
  padding: 0 14px 14px;
  border-top: 1px solid var(--border);
}

.question-card.is-open .question-card__body {
  display: block;
}

/* Choice rows */
.choice-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surf-2) 50%, transparent);
  margin-top: 8px;
}

.choice-row__drag {
  cursor: grab;
  color: var(--muted);
  opacity: .45;
  font-size: 12px;
}

.choice-row__text {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
}

.choice-row__text:focus {
  outline: none;
}

.choice-row__correct {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid rgba(165, 176, 194, .3);
  background: transparent;
  cursor: pointer;
  appearance: none;
  transition: .15s;
  flex-shrink: 0;
}

.choice-row__correct:checked {
  background: var(--primary);
  border-color: var(--primary);
}

.choice-row__label {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  white-space: nowrap;
}

.choice-row__del {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(239, 68, 68, .5);
  font-size: 12px;
  padding: 3px 5px;
  border-radius: 5px;
  transition: .15s;
}

.choice-row__del:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, .1);
}

.ordering-label {
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(245, 158, 11, .12);
  border: 1px solid rgba(245, 158, 11, .25);
  color: #fbbf24;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
  line-height: 22px;
  flex-shrink: 0;
}

.sortable-ghost {
  opacity: .35;
}

.sortable-drag {
  box-shadow: 0 8px 30px rgba(var(--primary-rgb), .4);
}

/* Autosave indicator */
.autosave-indicator {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0;
  transition: .3s;
}

.autosave-indicator.is-saving {
  opacity: 1;
  color: #f59e0b;
}

.autosave-indicator.is-saved {
  opacity: 1;
  color: #22c55e;
}

/* ==========================================================
   COURSE CARDS (learner + editor home)
   ========================================================== */

.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.course-card {
  background: color-mix(in srgb, var(--surf-2) 80%, transparent);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  text-decoration: none;
  color: var(--text);
  transition: .2s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.course-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary2));
  transform: scaleX(0);
  transform-origin: left;
  transition: .25s ease;
}

.course-card:hover {
  transform: translateY(-3px);
  border-color: rgba(var(--primary-rgb), .3);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
}

.course-card:hover::before {
  transform: scaleX(1);
}

.course-card__type {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--muted);
}

.course-card__title {
  font-size: 17px;
  font-weight: 900;
  line-height: 1.3;
}

.course-card__desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  flex: 1;
}

.course-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}

.course-card__meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 12px;
}

/* ==========================================================
   LEARNER VIEW
   ========================================================== */

.learn-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 60px);
}

.learn-nav {
  border-right: 1px solid var(--border);
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.learn-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--muted);
  border: 1px solid transparent;
  transition: .15s;
  font-size: 13px;
  font-weight: 700;
}

.learn-nav-item:hover {
  background: rgba(var(--primary-rgb), .07);
  color: var(--text);
}

.learn-nav-item.is-active {
  background: rgba(var(--primary-rgb), .15);
  border-color: rgba(var(--primary-rgb), .3);
  color: var(--text);
}

.learn-nav-item__icon {
  font-size: 14px;
  width: 20px;
  text-align: center;
}

.learn-content {
  padding: 36px 44px;
  max-width: 780px;
}

.learn-module {
  margin-bottom: 40px;
}

.learn-module__title {
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.learn-module__richtext {
  font-size: 15px;
  line-height: 1.75;
  color: #d1d9e6;
}

.learn-module__richtext h1,
h2,
h3 {
  color: var(--text);
}

.learn-module__richtext a {
  color: var(--primary2);
}

.learn-module__richtext code {
  background: rgba(var(--primary-rgb), .12);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: .9em;
}

.learn-module__richtext pre {
  background: rgba(0, 0, 0, .4);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  overflow: auto;
}

.learn-module__richtext img {
  max-width: 100%;
  border-radius: 10px;
}

.learn-module__img img {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border);
}

.learn-module__video video {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border);
}

/* ==========================================================
   QUIZ PLAYER
   ========================================================== */

.qplayer {
  max-width: 680px;
  margin: 0 auto;
  padding: 36px 24px;
}

.qplayer__header {
  margin-bottom: 32px;
}

.qplayer__title {
  font-size: 24px;
  font-weight: 900;
}

.qplayer__meta {
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
}

.qcard {
  background: color-mix(in srgb, var(--surf-2) 70%, transparent);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 14px;
}

.qcard__num {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--muted);
  margin-bottom: 10px;
}

.qcard__prompt {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.5;
  margin-bottom: 16px;
}

.qcard__type-label {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .3px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Choice options */
.qchoice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surf-1) 45%, transparent);
  cursor: pointer;
  transition: .15s;
  margin-bottom: 8px;
}

.qchoice:hover {
  border-color: rgba(var(--primary-rgb), .3);
  background: rgba(var(--primary-rgb), .06);
}

.qchoice input {
  display: none;
}

.qchoice__indicator {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(165, 176, 194, .3);
  flex-shrink: 0;
  transition: .15s;
}

.qchoice--checkbox .qchoice__indicator {
  border-radius: 6px;
}

.qchoice input:checked~.qchoice__indicator {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .2);
}

.qchoice__text {
  font-size: 14px;
  font-weight: 600;
}

/* Ordering drag item */
.order-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surf-2);
  cursor: grab;
  margin-bottom: 8px;
  transition: .15s;
}

.order-item:hover {
  border-color: rgba(245, 158, 11, .3);
}

.order-item__handle {
  color: var(--muted);
  opacity: .5;
  font-size: 13px;
}

.order-item__text {
  font-size: 14px;
  font-weight: 600;
}

.order-item__num {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: rgba(245, 158, 11, .12);
  border: 1px solid rgba(245, 158, 11, .25);
  color: #fbbf24;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
  line-height: 24px;
  flex-shrink: 0;
}

/* Quiz Result */
.result-card {
  max-width: 500px;
  margin: 60px auto;
  background: color-mix(in srgb, var(--surf-2) 85%, transparent);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 40px;
  text-align: center;
}

.result-score {
  font-size: 72px;
  font-weight: 1000;
  line-height: 1;
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}

.result-card__title {
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 6px;
}

.result-card__sub {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 28px;
}

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

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

.btn-sm {
  padding: 7px 12px;
  border-radius: 10px;
  font-size: 12px;
}

.btn-danger {
  background: rgba(239, 68, 68, .12);
  border-color: rgba(239, 68, 68, .25);
  color: #f87171;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, .2);
}

.btn-success {
  background: rgba(34, 197, 94, .12);
  border-color: rgba(34, 197, 94, .25);
  color: #4ade80;
}

.btn-success:hover {
  background: rgba(34, 197, 94, .2);
}

/* section divider label */
.section-label {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 20px 0 10px;
}

/* Input group row */
.input-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.input-row .input {
  flex: 1;
}