:root {
  --bg: #f3f6f2;
  --bg-accent: #e4efe6;
  --surface: #ffffff;
  --ink: #1c2a22;
  --muted: #5c6b61;
  --line: #d5e0d8;
  --brand: #1f6b4a;
  --brand-dark: #155239;
  --brand-soft: #d9efe4;
  --danger: #9b2c2c;
  --danger-soft: #fde8e8;
  --radius: 14px;
  --shadow: 0 18px 40px rgba(28, 42, 34, 0.08);
  --font: "Segoe UI", "Trebuchet MS", sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(31, 107, 74, 0.12), transparent 36%),
    linear-gradient(160deg, var(--bg), var(--bg-accent));
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.shell {
  width: min(960px, calc(100% - 2rem));
  margin: 0 auto;
}

.guest-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}

.auth-landing {
  width: min(920px, 100%);
  display: grid;
  gap: 1.25rem;
  align-items: stretch;
}

.auth-intro {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  padding: 1.5rem 1.25rem;
  border-radius: calc(var(--radius) + 4px);
  background:
    linear-gradient(155deg, rgba(31, 107, 74, 0.12), transparent 55%),
    rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(213, 224, 216, 0.9);
}

.auth-intro .brand {
  margin-bottom: 0;
}

.auth-intro .brand h1 {
  font-size: clamp(1.7rem, 3vw, 2.05rem);
}

.auth-benefits {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.auth-benefits li {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.auth-benefit-icon {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.auth-benefits strong {
  display: block;
  font-size: 0.95rem;
  line-height: 1.3;
  margin-bottom: 0.15rem;
}

.auth-benefits span {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.auth-intro-cta {
  margin-top: auto;
  display: grid;
  gap: 0.75rem;
  padding-top: 0.25rem;
}

.auth-intro-cta .btn {
  width: fit-content;
}

.auth-landing .auth-form-panel {
  width: 100%;
}

.auth-form-panel .brand-compact {
  margin-bottom: 1.1rem;
}

.auth-form-panel .brand-compact h2 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.25;
}

@media (min-width: 800px) {
  .auth-landing {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) + 6px);
    box-shadow: var(--shadow);
    overflow: hidden;
  }

  .auth-intro {
    border: 0;
    border-radius: 0;
    padding: 2rem 1.75rem;
    background:
      radial-gradient(circle at top left, rgba(31, 107, 74, 0.16), transparent 42%),
      linear-gradient(165deg, #eef6f1, #f7faf7);
  }

  .auth-form-panel {
    width: 100%;
    max-width: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 2rem 1.75rem;
  }
}

.panel {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  padding: 1.75rem;
}

.panel.wide {
  width: min(560px, 100%);
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--brand), #2f8f66);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand h1 {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.2;
}

.brand p,
.muted {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.stack {
  display: grid;
  gap: 0.9rem;
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field label {
  font-size: 0.88rem;
  font-weight: 600;
}

.field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  font: inherit;
  color: var(--ink);
  background: #fbfcfb;
}

.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  font: inherit;
  color: var(--ink);
  background: #fbfcfb;
}

.field input:focus,
.field select:focus {
  outline: 2px solid rgba(31, 107, 74, 0.25);
  border-color: var(--brand);
  background: white;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 2.7rem;
}

.password-field input::-ms-reveal,
.password-field input::-ms-clear {
  display: none;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.3rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.password-toggle:hover,
.password-toggle[aria-pressed="true"] {
  color: var(--brand);
  background: var(--brand-soft);
}

.password-toggle:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.password-toggle svg {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
}

.password-field.is-visible .password-toggle [data-icon="show"],
.password-field:not(.is-visible) .password-toggle [data-icon="hide"] {
  display: none;
}

.field .hint {
  font-size: 0.8rem;
  color: var(--muted);
}

.field .error,
.alert.error {
  color: var(--danger);
  font-size: 0.85rem;
}

.alert {
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  font-size: 0.92rem;
}

.alert.error {
  background: var(--danger-soft);
}

.alert.success {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 0;
  border-radius: 10px;
  padding: 0.8rem 1rem;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--brand-dark);
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  color: var(--brand-dark);
  border: 1px solid var(--line);
}

.grid-2 {
  display: grid;
  gap: 0.9rem;
}

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

.auth-switch {
  margin-top: 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}

.app-body {
  min-height: 100vh;
}

.app-shell {
  --sidebar-width: 272px;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  position: relative;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(18, 28, 22, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 30;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(var(--sidebar-width), 88vw);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem 0.9rem 1.1rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 248, 0.98)),
    var(--surface);
  border-right: 1px solid var(--line);
  box-shadow: 12px 0 40px rgba(28, 42, 34, 0.08);
  transform: translateX(-105%);
  transition: transform 0.24s ease;
  z-index: 40;
}

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

body.sidebar-open .sidebar-overlay {
  opacity: 1;
  pointer-events: auto;
}

.sidebar-brand {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0.35rem 0.15rem;
}

.sidebar .brand-inline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.sidebar .brand-inline:hover {
  text-decoration: none;
}

.brand-copy {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.brand-copy strong {
  font-size: 1.02rem;
  line-height: 1.2;
}

.brand-copy span {
  color: var(--muted);
  font-size: 0.78rem;
}

.sidebar-close,
.menu-toggle {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.sidebar-close svg,
.menu-toggle svg,
.sidebar-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.sidebar-close:hover,
.menu-toggle:hover {
  background: var(--brand-soft);
  border-color: #b7d7c6;
}

.sidebar-nav {
  display: grid;
  gap: 0.35rem;
  flex: 1;
  overflow-y: auto;
  padding: 0.2rem 0.2rem 0.5rem;
}

.sidebar-label {
  margin: 0.35rem 0.55rem 0.45rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.78rem 0.85rem;
  border-radius: 12px;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-link:hover {
  background: rgba(31, 107, 74, 0.08);
  color: var(--brand-dark);
  text-decoration: none;
}

.sidebar-link.is-active {
  background: var(--brand-soft);
  color: var(--brand-dark);
  box-shadow: inset 0 0 0 1px rgba(31, 107, 74, 0.12);
}

.sidebar-icon {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  color: inherit;
  flex-shrink: 0;
}

.sidebar-dropdown {
  display: grid;
  gap: 0.35rem;
}

.sidebar-dropdown-trigger {
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.sidebar-dropdown-label {
  flex: 1;
  min-width: 0;
}

.sidebar-dropdown-chevron {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: inline-grid;
  place-items: center;
  color: var(--muted);
  background: rgba(28, 42, 34, 0.04);
  transition: transform 0.22s ease, background 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}

.sidebar-dropdown-chevron svg {
  width: 16px;
  height: 16px;
  display: block;
}

.sidebar-dropdown-trigger:hover .sidebar-dropdown-chevron,
.sidebar-dropdown.is-open .sidebar-dropdown-chevron {
  background: rgba(31, 107, 74, 0.12);
  color: var(--brand-dark);
}

.sidebar-dropdown.is-open .sidebar-dropdown-chevron {
  transform: rotate(180deg);
}

.sidebar-dropdown-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.24s ease;
}

.sidebar-dropdown.is-open .sidebar-dropdown-panel {
  grid-template-rows: 1fr;
}

.sidebar-dropdown-menu {
  overflow: hidden;
  min-height: 0;
  display: grid;
  gap: 0.2rem;
  margin: 0 0.15rem;
  padding: 0.35rem;
  border: 1px solid rgba(31, 107, 74, 0.14);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(241, 248, 244, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 10px 24px rgba(28, 42, 34, 0.06);
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.22s ease;
}

.sidebar-dropdown.is-open .sidebar-dropdown-menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.sidebar-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.68rem 0.78rem;
  border-radius: 11px;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.94rem;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.sidebar-dropdown-item:hover {
  background: rgba(31, 107, 74, 0.08);
  color: var(--brand-dark);
  text-decoration: none;
}

.sidebar-dropdown-item.is-active {
  background: var(--brand-soft);
  color: var(--brand-dark);
  box-shadow: inset 0 0 0 1px rgba(31, 107, 74, 0.14);
}

.sidebar-dropdown-item-icon {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  color: inherit;
  opacity: 0.88;
  flex-shrink: 0;
}

.sidebar-dropdown-item-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.sidebar-footer {
  display: grid;
  gap: 0.55rem;
  padding: 0.75rem 0.35rem 0.15rem;
  border-top: 1px solid var(--line);
}

.school-switch {
  display: grid;
  gap: 0.3rem;
  padding: 0 0.45rem 0.15rem;
}

.school-switch-label {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.school-switch select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface, #fff);
  color: inherit;
  font: inherit;
  font-size: 0.86rem;
  padding: 0.45rem 0.55rem;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.35rem 0.45rem;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  border-radius: 12px;
  transition: background 0.15s ease;
}

a.sidebar-user:hover {
  background: rgba(47, 143, 102, 0.08);
}

.sidebar-avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(145deg, #2f8f66, var(--brand-dark));
  color: white;
  display: grid;
  place-items: center;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-user-meta {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.sidebar-user-meta strong,
.sidebar-user-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-meta strong {
  font-size: 0.92rem;
}

.sidebar-user-meta span {
  color: var(--muted);
  font-size: 0.78rem;
}

.sidebar-logout {
  color: var(--danger);
}

.sidebar-logout:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.app-frame {
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  backdrop-filter: blur(10px);
  background: rgba(243, 246, 242, 0.9);
  border-bottom: 1px solid var(--line);
}

.menu-toggle {
  position: relative;
}

.menu-toggle[aria-expanded="true"] {
  background: var(--brand-soft);
  border-color: #b7d7c6;
  color: var(--brand-dark);
}

.topbar-title {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.topbar-title strong {
  display: block;
  font-size: 1rem;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-school {
  color: var(--muted);
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-main {
  width: min(1100px, calc(100% - 2rem));
  margin: 1.25rem auto 2.5rem;
  flex: 1;
}

@media (max-width: 959px) {
  body.sidebar-open {
    overflow: hidden;
  }
}

@media (min-width: 960px) {
  .app-shell {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    transition: grid-template-columns 0.24s ease;
  }

  body.sidebar-collapsed .app-shell {
    grid-template-columns: 0 minmax(0, 1fr);
  }

  .sidebar-overlay {
    display: none;
  }

  .sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    width: var(--sidebar-width);
    min-width: 0;
    transform: none;
    box-shadow: none;
    overflow-x: hidden;
    overflow-y: auto;
    transition: opacity 0.18s ease, padding 0.24s ease, border-color 0.24s ease;
  }

  body.sidebar-collapsed .sidebar {
    width: 0;
    padding-left: 0;
    padding-right: 0;
    opacity: 0;
    pointer-events: none;
    border-right-color: transparent;
  }

  .sidebar-close {
    display: none;
  }

  .topbar {
    padding-left: 1.25rem;
    padding-right: 1.5rem;
  }

  .topbar-title strong {
    font-size: 1.08rem;
  }

  .app-main {
    margin-top: 1.5rem;
    margin-bottom: 3rem;
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.4rem;
}

.user-meta {
  display: grid;
  gap: 0.25rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.user-meta strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.page-head > div > .muted {
  margin: 0;
  max-width: 40rem;
  line-height: 1.45;
}

.page-head h1,
.card-title {
  margin: 0 0 0.25rem;
  font-size: 1.35rem;
}

.card-title {
  font-size: 1.1rem;
  margin-bottom: 0.85rem;
}

.layout-split {
  display: grid;
  gap: 1rem;
}

@media (min-width: 900px) {
  .layout-split {
    grid-template-columns: 320px 1fr;
    align-items: start;
  }
}

.table-wrap {
  overflow-x: auto;
  margin: 0 -0.25rem;
  padding: 0 0.25rem;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

.table th,
.table td {
  text-align: left;
  padding: 0.95rem 1rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.table tbody tr:last-child th,
.table tbody tr:last-child td {
  border-bottom: 0;
}

.table th {
  color: var(--muted);
  font-weight: 650;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.table .col-num {
  width: 3.25rem;
  text-align: center;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.table thead .col-num {
  font-size: 0.78rem;
}

.table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.table-actions form {
  display: inline-flex;
  margin: 0;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f7faf8;
  color: var(--brand-dark);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
  padding: 0;
  font: inherit;
}

.btn-icon:hover {
  background: var(--brand-soft);
  border-color: #b7d7c6;
  color: var(--brand);
  text-decoration: none;
}

.btn-icon:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.btn-icon svg {
  width: 1.05rem;
  height: 1.05rem;
  display: block;
}

.btn-icon.danger {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: #f3c6c6;
}

.btn-icon.danger:hover {
  background: #fbd0d0;
  border-color: #e8a0a0;
  color: #7f1d1d;
}

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

.btn-icon.primary:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #fff;
}

.link-danger {
  border: 0;
  background: none;
  padding: 0;
  color: var(--danger);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}

.compact-list {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
}

.card + .card,
.alert + .card,
.alert + .dash-hero,
.page-head + .alert,
.alert + .alert {
  margin-top: 0.9rem;
}

.page-head + .layout-split,
.page-head + .card {
  margin-top: 0.25rem;
}

code {
  font-size: 0.9em;
  background: var(--brand-soft);
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
}

input[type="file"] {
  width: 100%;
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 0.85rem;
  background: #fbfcfb;
}

.hafalan-form {
  margin-bottom: 0.9rem;
}

.hafalan-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.85rem 1.25rem;
}

.hafalan-topbar .field {
  flex: 1 1 220px;
  margin: 0;
}

.hafalan-progress-pill {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
}

.hafalan-progress-pill strong {
  color: var(--brand-dark);
}

.hafalan-card {
  max-width: 720px;
}

.hafalan-card.is-fokus {
  max-width: min(860px, 100%);
}

.siswa-queue {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding-bottom: 0.35rem;
}

.siswa-chip {
  border: 1px solid var(--line);
  background: #fbfcfb;
  color: var(--ink);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.siswa-chip:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.siswa-chip.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.siswa-chip.is-done:not(.is-active) {
  color: var(--muted);
}

.chip-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--brand);
}

.siswa-chip.is-active .chip-dot {
  background: #fff;
}

.hafalan-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.jenis-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  background: #eef4f0;
  padding: 0.3rem;
  border-radius: 12px;
  min-width: min(260px, 100%);
}

.hafalan-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.advance-check {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
}

.advance-check input {
  margin-top: 0.2rem;
  accent-color: var(--brand);
}

.kbd-hint {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.22);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.btn-status.ulang .kbd-hint {
  background: rgba(138, 75, 22, 0.12);
}

.hint kbd {
  display: inline-block;
  padding: 0.05rem 0.35rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  font-size: 0.8rem;
  font-family: inherit;
  font-weight: 700;
}

body.hafalan-fokus-on .sidebar,
body.hafalan-fokus-on .sidebar-overlay,
body.hafalan-fokus-on .topbar,
body.hafalan-fokus-on .fokus-hide {
  display: none !important;
}

@media (min-width: 960px) {
  body.hafalan-fokus-on .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }
}

body.hafalan-fokus-on .app-main {
  max-width: 900px;
  margin-inline: auto;
  width: 100%;
}

body.hafalan-fokus-on .hafalan-step {
  grid-template-columns: 1fr;
}

body.hafalan-fokus-on .hafalan-status-step {
  position: sticky;
  bottom: 0;
  z-index: 5;
  background: linear-gradient(180deg, transparent, var(--surface) 28%);
  padding-top: 1rem;
  margin: 0 -0.25rem;
  padding-inline: 0.25rem;
}

body.hafalan-fokus-on .ayat-list {
  max-height: min(62vh, 640px);
}

body.hafalan-fokus-on .ayat-arab {
  font-size: 2.05rem;
}

.attention-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.attention-card .card-title {
  font-size: 1rem;
}

.attention-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.attention-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--line);
}

.attention-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.attention-list li > div {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.attention-list strong,
.attention-list .muted {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.murojaah-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.murojaah-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}

.murojaah-list li:last-child {
  border-bottom: 0;
}

.murojaah-main {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.murojaah-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.murojaah-meta time {
  font-size: 0.85rem;
  color: var(--muted);
}

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

.hafalan-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: start;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
}

.hafalan-step:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.step-badge {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: 1.7rem;
}

.field-label {
  font-size: 0.88rem;
  font-weight: 600;
}

.status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.btn-status {
  border: 0;
  border-radius: 12px;
  min-height: 56px;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-status.lancar {
  background: var(--brand);
  color: #fff;
}

.btn-status.lancar:hover {
  background: var(--brand-dark);
}

.btn-status.ulang {
  background: #f6e7d8;
  color: #8a4b16;
}

.btn-status.ulang:hover {
  background: #efd5bc;
}

.recent-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}

.recent-list li {
  display: grid;
  gap: 0.15rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--line);
}

.recent-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.btn-sm {
  padding: 0.45rem 0.7rem;
  font-size: 0.85rem;
}

.tampil-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  background: #eef4f0;
  padding: 0.3rem;
  border-radius: 12px;
}

.tampil-btn {
  border: 0;
  border-radius: 9px;
  padding: 0.55rem 0.7rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 650;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.tampil-btn.is-active {
  background: #fff;
  color: var(--brand-dark);
  box-shadow: 0 1px 3px rgba(28, 42, 34, 0.08);
}

.ayat-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.ayat-list {
  max-height: min(55vh, 480px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfb;
}

.ayat-item {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 0.65rem;
  align-items: start;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.ayat-item:last-child {
  border-bottom: 0;
}

.ayat-item:has(input:checked) {
  background: var(--brand-soft);
}

.ayat-item input {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.35rem;
  accent-color: var(--brand);
}

.ayat-num {
  min-width: 1.5rem;
  margin-top: 0.3rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--brand-dark);
}

.ayat-body {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.ayat-arab {
  font-size: 1.85rem;
  line-height: 2;
  font-family: "Scheherazade New", "Amiri", "Traditional Arabic", "Segoe UI", serif;
  color: var(--ink);
}

.ayat-terjemah {
  display: none;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--muted);
}

.ayat-list.show-terjemah .ayat-terjemah {
  display: block;
}

@media (max-width: 640px) {
  .hafalan-card {
    max-width: none;
  }

  .btn-status {
    min-height: 64px;
    font-size: 1.1rem;
  }

  .ayat-arab {
    font-size: 1.65rem;
  }
}

.grid-3 {
  display: grid;
  gap: 0.9rem;
}

@media (min-width: 768px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.filter-bar {
  margin-bottom: 0.9rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 650;
}

.badge-ok {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.badge-warn {
  background: #f6e7d8;
  color: #8a4b16;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  display: grid;
  gap: 0.2rem;
}

.stat-card strong {
  font-size: 1.35rem;
}

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

  .dash-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dash-stats .stat-card {
    padding: 0.75rem 0.65rem;
  }

  .dash-stats .stat-card strong {
    font-size: 1.15rem;
  }

  .dash-stats .stat-card .muted {
    font-size: 0.75rem;
  }
}

.dash-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1.35rem 1.25rem;
  border-radius: calc(var(--radius) + 2px);
  border: 1px solid rgba(213, 224, 216, 0.95);
  background:
    radial-gradient(circle at top right, rgba(31, 107, 74, 0.14), transparent 42%),
    linear-gradient(155deg, rgba(255, 255, 255, 0.92), rgba(238, 246, 241, 0.9));
}

.dash-hero-main {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 0.35rem;
}

.dash-kicker {
  margin: 0;
  color: var(--brand-dark);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.dash-hero h1 {
  margin: 0;
  font-size: clamp(1.35rem, 3.4vw, 1.75rem);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.dash-avatar {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(145deg, #2f8f66, var(--brand-dark));
  color: white;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  font-weight: 700;
  flex-shrink: 0;
}

.dash-stats {
  margin-bottom: 1.35rem;
}

.dash-section {
  margin-bottom: 1.35rem;
}

.dash-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.dash-section-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.dash-section-head.compact {
  margin-bottom: 0;
  align-items: center;
}

.dash-section-head.compact .card-title {
  margin: 0;
}

.dash-link {
  font-size: 0.9rem;
  font-weight: 650;
  white-space: nowrap;
}

.dash-actions {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr;
}

.dash-action {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 1.05rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(28, 42, 34, 0.04);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.dash-action:hover {
  text-decoration: none;
  border-color: #b7d7c6;
  background: #f7fbf8;
  transform: translateY(-1px);
}

.dash-action-primary {
  background:
    linear-gradient(145deg, rgba(31, 107, 74, 0.1), rgba(255, 255, 255, 0.95)),
    var(--surface);
  border-color: rgba(31, 107, 74, 0.22);
}

.dash-action-primary:hover {
  background:
    linear-gradient(145deg, rgba(31, 107, 74, 0.14), rgba(255, 255, 255, 0.98)),
    var(--surface);
}

.dash-action-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.dash-action-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.dash-action-copy {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.dash-action-copy strong {
  font-size: 0.98rem;
  line-height: 1.3;
}

.dash-action-copy span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.dash-empty {
  margin-top: 0.25rem;
}

.dash-grid {
  display: grid;
  gap: 0.9rem;
}

.dash-feed,
.dash-kelas-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.15rem;
}

.dash-feed li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}

.dash-feed li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.dash-feed li:first-child {
  padding-top: 0.15rem;
}

.dash-feed-main {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.dash-feed-main strong,
.dash-feed-main span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-feed-meta {
  display: grid;
  gap: 0.35rem;
  justify-items: end;
  flex-shrink: 0;
  text-align: right;
}

.dash-feed-meta time {
  color: var(--muted);
  font-size: 0.8rem;
}

.dash-kelas-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.15rem;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}

.dash-kelas-list li:last-child a {
  border-bottom: 0;
}

.dash-kelas-list a:hover {
  color: var(--brand-dark);
  text-decoration: none;
}

.dash-kelas-list a > span:first-child {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.dash-kelas-count {
  color: var(--muted);
  font-size: 0.84rem;
  white-space: nowrap;
}

@media (min-width: 640px) {
  .dash-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dash-action-primary {
    grid-column: 1 / -1;
  }

  .stat-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 900px) {
  .dash-hero {
    padding: 1.5rem 1.45rem;
  }

  .dash-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dash-grid {
    grid-template-columns: 1.15fr 0.85fr;
    align-items: start;
  }
}

@media (max-width: 520px) {
  .dash-hero {
    padding: 1.15rem 1rem;
  }

  .dash-avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    font-size: 1rem;
  }

  .dash-feed li {
    flex-direction: column;
    align-items: stretch;
  }

  .dash-feed-meta {
    justify-items: start;
    grid-auto-flow: column;
    grid-template-columns: auto auto;
    align-items: center;
    text-align: left;
  }
}

.surat-pick-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.65rem;
}

.surat-pick-grid {
  max-height: min(50vh, 420px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfb;
}

.surat-pick-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.55rem;
  align-items: center;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  font-size: 0.92rem;
}

.surat-pick-item:last-child {
  border-bottom: 0;
}

.surat-pick-item:has(input:checked) {
  background: var(--brand-soft);
}

.legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.cell-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.5rem;
  padding: 0.28rem 0.5rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.cell-pill.tuntas {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.cell-pill.proses {
  background: #f6e7d8;
  color: #8a4b16;
}

.cell-pill.belum {
  background: #eceff1;
  color: #546e7a;
}

.matrix-wrap {
  max-height: min(70vh, 640px);
  overflow: auto;
}

.matrix-table th,
.matrix-table td {
  white-space: nowrap;
  vertical-align: middle;
  padding: 0.85rem 0.9rem;
}

.matrix-table thead th {
  position: sticky;
  top: 0;
  background: #f7faf8;
  z-index: 2;
}

.matrix-table .sticky-col {
  position: sticky;
  background: #fff;
  z-index: 1;
}

.matrix-table .sticky-num {
  left: 0;
  min-width: 3.25rem;
  width: 3.25rem;
  text-align: center;
  font-weight: 600;
  box-shadow: 1px 0 0 var(--line);
}

.matrix-table .sticky-label {
  left: 3.25rem;
  text-align: left;
  min-width: 140px;
  font-weight: 650;
  box-shadow: 4px 0 10px rgba(28, 42, 34, 0.04);
}

.matrix-table thead .sticky-col {
  z-index: 3;
  background: #f7faf8;
}

.matrix-table tbody th.sticky-label {
  background: #fff;
}

a.cell-pill.is-link {
  text-decoration: none;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

a.cell-pill.is-link:hover {
  filter: brightness(0.96);
  text-decoration: none;
  transform: translateY(-1px);
}

/* Bahan ajar gallery */
.bahan-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.8rem;
  margin-bottom: 0.85rem;
}

.bahan-filter select,
.bahan-filter input[type="search"] {
  min-height: 2.35rem;
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  color: var(--ink);
}

.bahan-filter select {
  min-width: 8.5rem;
  max-width: 12rem;
}

.bahan-filter input[type="search"] {
  flex: 1 1 10rem;
  min-width: 8rem;
}

.bahan-filter .btn {
  min-height: 2.35rem;
  padding: 0.4rem 0.85rem;
  white-space: nowrap;
}

.bahan-filter-add {
  margin-left: auto;
}

.bahan-count {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
}

.bahan-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 900px) {
  .bahan-gallery {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 4 kolom hanya saat area konten cukup lebar (viewport ~ÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¢ÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¥1440 dengan sidebar) */
@media (min-width: 1440px) {
  .bahan-gallery {
    grid-template-columns: repeat(4, 1fr);
  }
}

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

  .bahan-filter-add {
    margin-left: 0;
  }
}

.bahan-card {
  --bahan-accent: var(--brand);
  --bahan-soft: #e8f2ec;
  --bahan-ink: var(--brand-dark, #1f6b45);
  position: relative;
  background: var(--surface);
  border: 1px solid rgba(213, 224, 216, 0.95);
  border-radius: calc(var(--radius) + 4px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 10px rgba(28, 42, 34, 0.04);
  transition:
    box-shadow 0.22s ease,
    transform 0.22s ease,
    border-color 0.22s ease;
}

.bahan-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--bahan-accent), color-mix(in srgb, var(--bahan-accent) 35%, white));
  opacity: 0.9;
  z-index: 3;
}

.bahan-card:hover {
  border-color: color-mix(in srgb, var(--bahan-accent) 28%, var(--line));
  box-shadow:
    0 14px 32px rgba(28, 42, 34, 0.1),
    0 2px 8px rgba(28, 42, 34, 0.04);
  transform: translateY(-3px);
}

.bahan-card.bahan-type-upload {
  --bahan-accent: #1f6b4a;
  --bahan-soft: #e4f3eb;
  --bahan-ink: #155239;
}

.bahan-card.bahan-type-gdrive {
  --bahan-accent: #1a56db;
  --bahan-soft: #e8f0fe;
  --bahan-ink: #1a56db;
}

.bahan-card.bahan-type-youtube {
  --bahan-accent: #c81e1e;
  --bahan-soft: #fde8e8;
  --bahan-ink: #b42318;
}

.bahan-card.bahan-type-onedrive {
  --bahan-accent: #0b6cbd;
  --bahan-soft: #e8f4fc;
  --bahan-ink: #0b6cbd;
}

.bahan-card.bahan-type-canva {
  --bahan-accent: #7a3af0;
  --bahan-soft: #f3e8ff;
  --bahan-ink: #7a3af0;
}

.bahan-card.bahan-type-vimeo {
  --bahan-accent: #1ab7ea;
  --bahan-soft: #e8f7fb;
  --bahan-ink: #0e8fb8;
}

.bahan-card-main {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  min-width: 0;
  flex: 1;
}

.bahan-card-main:hover {
  text-decoration: none;
}

.bahan-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.55), transparent 42%),
    radial-gradient(circle at 85% 75%, rgba(255, 255, 255, 0.28), transparent 40%),
    linear-gradient(145deg, var(--bahan-soft), color-mix(in srgb, var(--bahan-soft) 55%, white));
  color: var(--bahan-ink);
}

.bahan-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 18px 18px;
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
}

.bahan-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  transition: transform 0.35s ease;
}

.bahan-card:hover .bahan-thumb img {
  transform: scale(1.05);
}

.bahan-thumb-fallback {
  display: grid;
  place-items: center;
  gap: 0.55rem;
  text-align: center;
  z-index: 1;
  padding: 1rem;
}

.bahan-thumb.has-img .bahan-thumb-fallback {
  opacity: 0;
  pointer-events: none;
}

.bahan-thumb-icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 8px 20px rgba(28, 42, 34, 0.08);
  backdrop-filter: blur(6px);
}

.bahan-thumb-icon svg {
  width: 28px;
  height: 28px;
}

.bahan-thumb-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.9;
}

.bahan-type-chip {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  z-index: 3;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--bahan-ink);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 12px rgba(28, 42, 34, 0.12);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  backdrop-filter: blur(8px);
}

.bahan-thumb-shade {
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  z-index: 2;
  background: linear-gradient(to top, rgba(15, 22, 18, 0.28), transparent);
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: none;
}

.bahan-thumb.has-img .bahan-thumb-shade,
.bahan-card:hover .bahan-thumb-shade {
  opacity: 1;
}

.bahan-play {
  position: absolute;
  z-index: 3;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: rgba(15, 22, 18, 0.55);
  color: #fff;
  display: grid;
  place-items: center;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(6px);
  transition: transform 0.22s ease, background 0.22s ease;
}

.bahan-card:hover .bahan-play {
  transform: scale(1.08);
  background: rgba(15, 22, 18, 0.68);
}

.bahan-play svg {
  width: 22px;
  height: 22px;
  margin-left: 2px;
}

.bahan-type-upload,
.bahan-type-gdrive,
.bahan-type-youtube,
.bahan-type-onedrive,
.bahan-type-canva,
.bahan-type-vimeo {
  color: var(--bahan-ink);
}

.bahan-card-body {
  min-width: 0;
  display: grid;
  gap: 0.4rem;
  padding: 0.95rem 1rem 0.45rem;
}

.bahan-card-body h2 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.18s ease;
}

.bahan-card:hover .bahan-card-body h2 {
  color: var(--bahan-ink);
}

.bahan-card-kelas {
  margin: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.3;
}

.bahan-card-kelas-name {
  font-weight: 600;
  color: #405348;
}

.bahan-card-dot {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: #a7b5ab;
  flex-shrink: 0;
}

.bahan-card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.1rem;
}

.bahan-card-meta time {
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.bahan-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.35rem;
  padding: 0.55rem 0.85rem 0.85rem;
  margin-top: auto;
  border-top: 1px solid rgba(213, 224, 216, 0.7);
  background: linear-gradient(180deg, rgba(243, 246, 242, 0.35), transparent);
}

.bahan-card-actions form {
  display: inline;
  margin: 0;
}

.bahan-viewer {
  display: flex;
  flex-direction: column;
  background: #0f1612;
}

.bahan-viewer-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  background: #f7faf8;
  border-bottom: 1px solid var(--line);
}

.bahan-viewer-toolbar .btn {
  min-height: 2.1rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.9rem;
}

.bahan-viewer-toolbar .btn svg {
  width: 1.05rem;
  height: 1.05rem;
  display: block;
  flex-shrink: 0;
}

.bahan-viewer-frame {
  width: 100%;
  min-height: 70vh;
  border: 0;
  display: block;
  background: #fff;
  flex: 1;
}

.bahan-viewer:fullscreen {
  width: 100%;
  height: 100%;
  border-radius: 0;
  background: #111;
}

.bahan-viewer:fullscreen .bahan-viewer-toolbar {
  background: rgba(15, 22, 18, 0.92);
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

.bahan-viewer:fullscreen .bahan-viewer-toolbar .btn {
  color: #e8f0ea;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
}

.bahan-viewer:fullscreen .bahan-viewer-toolbar .btn:hover {
  background: rgba(255, 255, 255, 0.14);
  text-decoration: none;
}

.bahan-viewer:fullscreen .bahan-viewer-frame {
  min-height: 0;
  height: calc(100% - 3rem);
}

.bahan-viewer.is-image {
  background: #111;
}

.bahan-viewer-image-wrap {
  display: grid;
  place-items: center;
  min-height: 70vh;
  padding: 1rem;
  background: #111;
  flex: 1;
}

.bahan-viewer-image {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 4px;
}

.bahan-viewer:fullscreen .bahan-viewer-image-wrap {
  min-height: 0;
  height: calc(100% - 3rem);
}

.bahan-viewer:fullscreen .bahan-viewer-image {
  max-height: 100%;
}

/* Bahan ajar ÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¢ÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ form tambah */
.bahan-form-head .muted {
  max-width: 36rem;
}

.bahan-form-card {
  max-width: 720px;
  padding: 1.5rem;
  animation: bahan-form-in 0.35s ease both;
}

@keyframes bahan-form-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.bahan-form {
  display: grid;
  gap: 1.25rem;
}

.bahan-kelas-pick {
  max-height: min(36vh, 280px);
}

.bahan-form-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.bahan-char-count {
  font-size: 0.75rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.bahan-source-fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.bahan-source-fieldset legend {
  padding: 0;
  margin-bottom: 0.55rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.bahan-source-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

@media (min-width: 640px) {
  .bahan-source-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .bahan-source-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.bahan-source-card {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  width: 100%;
  margin: 0;
  padding: 0.85rem 0.9rem;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfb;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.bahan-source-card:hover {
  border-color: rgba(31, 107, 74, 0.35);
  background: #fff;
  transform: translateY(-1px);
}

.bahan-source-card:focus-visible {
  outline: 2px solid rgba(31, 107, 74, 0.35);
  outline-offset: 2px;
}

.bahan-source-card.is-active {
  border-color: var(--brand);
  background: linear-gradient(165deg, rgba(31, 107, 74, 0.08), #fff 55%);
  box-shadow: 0 0 0 3px rgba(31, 107, 74, 0.12);
}

.bahan-source-icon {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.bahan-source-icon svg {
  width: 1.2rem;
  height: 1.2rem;
}

.bahan-source-copy {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.bahan-source-copy strong {
  font-size: 0.92rem;
  line-height: 1.25;
}

.bahan-source-copy span {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.3;
}

.bahan-source-panels {
  position: relative;
  min-height: 0;
}

.bahan-panel {
  animation: none;
}

.bahan-panel.is-visible {
  animation: bahan-panel-in 0.28s ease both;
}

@keyframes bahan-panel-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.bahan-dropzone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 11.5rem;
  padding: 1.25rem;
  border: 1.5px dashed rgba(31, 107, 74, 0.35);
  border-radius: 14px;
  background:
    radial-gradient(circle at top, rgba(31, 107, 74, 0.06), transparent 55%),
    #f7faf8;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}

.bahan-dropzone:hover,
.bahan-dropzone.is-dragover {
  border-color: var(--brand);
  background:
    radial-gradient(circle at top, rgba(31, 107, 74, 0.1), transparent 55%),
    #eef6f1;
  box-shadow: inset 0 0 0 1px rgba(31, 107, 74, 0.08);
}

.bahan-dropzone.has-error {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.bahan-dropzone.has-file {
  border-style: solid;
  border-color: var(--line);
  background: #fff;
  cursor: default;
}

.bahan-dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  font-size: 0;
}

.bahan-dropzone.has-file input[type="file"] {
  pointer-events: none;
}

.bahan-dropzone-idle,
.bahan-dropzone-file {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 0.35rem;
  pointer-events: none;
  width: 100%;
}

.bahan-dropzone-file {
  grid-template-columns: auto 1fr auto;
  align-items: center;
  text-align: left;
  gap: 0.85rem;
  pointer-events: auto;
}

.bahan-dropzone-glyph {
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand-dark);
  margin-bottom: 0.25rem;
}

.bahan-dropzone-glyph svg {
  width: 1.4rem;
  height: 1.4rem;
}

.bahan-dropzone-idle strong {
  font-size: 1rem;
}

.bahan-dropzone-idle span {
  color: var(--muted);
  font-size: 0.86rem;
}

.bahan-dropzone-types {
  margin-top: 0.35rem;
  font-size: 0.72rem !important;
  letter-spacing: 0.02em;
  opacity: 0.85;
}

.bahan-file-badge {
  min-width: 3.1rem;
  height: 3.1rem;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.bahan-file-meta {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.bahan-file-meta strong {
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bahan-file-meta span {
  font-size: 0.8rem;
  color: var(--muted);
}

.bahan-url-wrap {
  position: relative;
  display: grid;
}

.bahan-url-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.15rem;
  height: 1.15rem;
  color: var(--muted);
  pointer-events: none;
  display: grid;
  place-items: center;
}

.bahan-url-icon svg {
  width: 100%;
  height: 100%;
}

.bahan-url-wrap[data-sumber="youtube"] .bahan-url-icon {
  color: #b42318;
}

.bahan-url-wrap[data-sumber="gdrive"] .bahan-url-icon {
  color: #1a56db;
}

.bahan-url-wrap[data-sumber="onedrive"] .bahan-url-icon {
  color: #0b6cbd;
}

.bahan-url-wrap[data-sumber="canva"] .bahan-url-icon {
  color: #7a3af0;
}

.bahan-url-wrap[data-sumber="vimeo"] .bahan-url-icon {
  color: #1ab7ea;
}

.bahan-url-wrap input {
  padding-left: 2.55rem !important;
}

.bahan-link-preview {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.15rem;
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  width: fit-content;
  animation: bahan-panel-in 0.22s ease both;
}

.bahan-link-preview-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: currentColor;
}

.bahan-link-preview.is-ok {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.bahan-link-preview.is-warn {
  background: #fff4e5;
  color: #9a6700;
}

.bahan-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--line);
  margin-top: 0.15rem;
}

.bahan-form-actions .btn svg {
  width: 1.05rem;
  height: 1.05rem;
}

.bahan-form-actions .btn-primary.is-loading {
  opacity: 0.72;
  pointer-events: none;
}

@media (max-width: 639px) {
  .bahan-form-card {
    padding: 1.15rem;
  }

  .bahan-dropzone-file {
    grid-template-columns: auto 1fr;
  }

  .bahan-dropzone-file .btn {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

/* ------------------------------------------------------------------
   Compact density for common laptop resolutions (e.g. 1366ÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ768)
   Tighter chrome + content so pages fit without feeling cramped.
   ------------------------------------------------------------------ */
@media (max-width: 1400px) and (min-width: 960px) {
  .app-shell {
    --sidebar-width: 236px;
  }

  .sidebar {
    gap: 0.75rem;
    padding: 0.75rem 0.7rem 0.9rem;
  }

  .sidebar-link {
    gap: 0.65rem;
    padding: 0.62rem 0.7rem;
    border-radius: 10px;
    font-size: 0.94rem;
  }

  .sidebar-dropdown-item {
    padding: 0.55rem 0.65rem;
    font-size: 0.9rem;
  }

  .sidebar-footer {
    padding-top: 0.55rem;
    gap: 0.4rem;
  }

  .sidebar-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .topbar {
    padding: 0.65rem 1rem;
  }

  .app-main {
    width: min(1100px, calc(100% - 1.5rem));
    margin: 1rem auto 1.75rem;
  }

  .card {
    padding: 1.1rem;
  }

  .page-head {
    margin-bottom: 0.75rem;
    gap: 0.75rem;
  }

  .page-head h1 {
    font-size: 1.22rem;
  }

  .layout-split {
    gap: 0.85rem;
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .table th,
  .table td {
    padding: 0.7rem 0.8rem;
  }

  .table {
    font-size: 0.9rem;
  }

  .dash-hero {
    padding: 1.05rem 1.1rem;
    margin-bottom: 0.85rem;
  }

  .dash-hero h1 {
    font-size: clamp(1.25rem, 2.2vw, 1.5rem);
  }

  .dash-avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    font-size: 1rem;
  }

  .dash-stats,
  .dash-section {
    margin-bottom: 1rem;
  }

  .dash-action {
    padding: 0.8rem 0.9rem;
    gap: 0.7rem;
  }

  .dash-action-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .bahan-form-card {
    padding: 1.2rem;
  }

  .bahan-source-card {
    padding: 0.7rem 0.75rem;
  }

  .bahan-dropzone {
    min-height: 9.5rem;
    padding: 1rem;
  }
}

/* Short laptop height (768px and similar) ÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¢ÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ reduce vertical chrome */
@media (max-height: 820px) and (min-width: 960px) {
  .sidebar {
    gap: 0.55rem;
    padding-top: 0.55rem;
    padding-bottom: 0.65rem;
  }

  .sidebar-brand {
    padding-top: 0.15rem;
    padding-bottom: 0;
  }

  .brand-copy strong {
    font-size: 0.95rem;
  }

  .sidebar-label {
    margin: 0.2rem 0.5rem 0.3rem;
  }

  .sidebar-link {
    padding: 0.52rem 0.65rem;
  }

  .sidebar-dropdown-item {
    padding: 0.48rem 0.6rem;
  }

  .sidebar-footer {
    padding-top: 0.45rem;
  }

  .topbar {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }

  .app-main {
    margin-top: 0.75rem;
    margin-bottom: 1.25rem;
  }

  .card {
    padding: 1rem;
  }

  .page-head {
    margin-bottom: 0.6rem;
  }

  .page-head h1,
  .card-title {
    font-size: 1.15rem;
  }

  .card-title {
    margin-bottom: 0.65rem;
  }

  .dash-hero {
    padding: 0.9rem 1rem;
    margin-bottom: 0.7rem;
  }

  .dash-stats,
  .dash-section {
    margin-bottom: 0.85rem;
  }

  .dash-section-head {
    margin-bottom: 0.55rem;
  }

  .stat-card {
    padding: 0.7rem 0.85rem;
  }

  .stat-card strong {
    font-size: 1.2rem;
  }

  .ayat-list {
    max-height: min(48vh, 360px);
  }

  .surat-pick-grid {
    max-height: min(42vh, 320px);
  }

  .matrix-wrap {
    max-height: min(62vh, 520px);
  }

  .matrix-table th,
  .matrix-table td {
    padding: 0.6rem 0.7rem;
  }

  .bahan-viewer-frame,
  .bahan-viewer-image-wrap {
    min-height: min(62vh, 520px);
  }

  .bahan-viewer-image {
    max-height: min(62vh, 520px);
  }

  .btn-status {
    min-height: 48px;
    font-size: 1rem;
  }

  .hafalan-step {
    padding: 0.65rem 0;
  }

  .step-badge {
    margin-top: 1.35rem;
  }

  .bahan-dropzone {
    min-height: 8.5rem;
  }
}

/* Combined: mid-width + short height (classic 1366ÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ768) */
@media (max-width: 1400px) and (max-height: 820px) and (min-width: 960px) {
  .app-shell {
    --sidebar-width: 220px;
  }

  .app-main {
    width: min(1100px, calc(100% - 1.25rem));
    margin: 0.65rem auto 1rem;
  }

  .layout-split {
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 0.75rem;
  }

  .table th,
  .table td {
    padding: 0.55rem 0.7rem;
  }

  .dash-grid {
    gap: 0.75rem;
  }

  .dash-action {
    padding: 0.7rem 0.8rem;
  }

  .bahan-gallery {
    gap: 0.7rem;
  }

  .bahan-filter {
    padding: 0.5rem 0.65rem;
    margin-bottom: 0.65rem;
  }
}

/* Auth / guest on short laptop screens */
@media (max-height: 820px) {
  .guest-shell {
    padding: 1rem;
    align-items: stretch;
  }

  .auth-landing {
    gap: 0.85rem;
  }

  .auth-intro {
    padding: 1.1rem 1.1rem;
    gap: 0.9rem;
  }

  .auth-benefits {
    gap: 0.55rem;
  }

  .auth-benefits span {
    font-size: 0.82rem;
  }

  .panel,
  .auth-form-panel {
    padding: 1.25rem;
  }

  .brand {
    margin-bottom: 0.85rem;
  }

  .brand h1 {
    font-size: 1.35rem;
  }

  .stack {
    gap: 0.7rem;
  }
}

@media (max-height: 820px) and (min-width: 800px) {
  .auth-intro,
  .auth-form-panel {
    padding: 1.35rem 1.4rem;
  }
}

/* ÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ Kuis ÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ */
.kuis-kode {
  font-weight: 700;
  letter-spacing: 0.06em;
  background: var(--brand-soft);
  color: var(--brand-dark);
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
}

.kuis-kode-lg {
  display: block;
  font-size: 1.6rem;
  letter-spacing: 0.12em;
  color: var(--brand-dark);
  margin-top: 0.15rem;
}

.kuis-link {
  display: block;
  font-size: 0.85rem;
  word-break: break-all;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
}

.kuis-share {
  display: grid;
  gap: 0.55rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(31, 107, 74, 0.08), transparent 70%), var(--bg);
  border: 1px solid var(--line);
}

.kuis-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.kuis-badge-on {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.kuis-badge-off {
  background: #eceff1;
  color: var(--muted);
}

.kuis-checks {
  display: grid;
  gap: 0.55rem;
}

.kuis-check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
}

.kuis-soal-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.85rem;
}

.kuis-soal-item {
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
}

.kuis-soal-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}

.kuis-opsi-preview {
  margin: 0.55rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.3rem;
}

.kuis-opsi-preview li {
  display: flex;
  gap: 0.4rem;
  align-items: baseline;
  color: var(--muted);
  font-size: 0.92rem;
}

.kuis-opsi-preview li.is-correct {
  color: var(--brand-dark);
  font-weight: 600;
}

.kuis-opsi-preview em {
  font-style: normal;
  font-size: 0.75rem;
  background: var(--brand-soft);
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
}

.kuis-opsi-fields {
  margin: 0;
  padding: 0.85rem 1rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.kuis-opsi-fields legend {
  padding: 0 0.35rem;
  font-weight: 600;
}

.kuis-opsi-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.55rem;
  align-items: center;
  margin-top: 0.55rem;
}

.kuis-opsi-radio {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
  color: var(--brand-dark);
  min-width: 2.5rem;
}

.kuis-opsi-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.kuis-public {
  width: min(560px, 100%);
}

.kuis-public-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  padding: 1.5rem 1.35rem;
  display: grid;
  gap: 1rem;
}

.kuis-public-card .brand-compact {
  text-align: center;
}

.kuis-public-card .brand-mark {
  margin: 0 auto 0.65rem;
}

.kuis-kode-input {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  font-size: 1.15rem;
}

.kuis-play {
  width: min(720px, 100%);
}

.kuis-play-head h1 {
  margin: 0.2rem 0;
  font-size: clamp(1.25rem, 3vw, 1.55rem);
}

.kuis-q {
  margin: 0;
  padding: 1rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
}

.kuis-q legend {
  padding: 0 0.25rem;
  font-weight: 650;
  line-height: 1.4;
}

.kuis-q-options {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.kuis-q-option {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.55rem;
  align-items: center;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
}

.kuis-q-option:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.kuis-q-option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.kuis-q-letter {
  width: 1.7rem;
  height: 1.7rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--brand-dark);
}

.kuis-q-option:has(input:checked) .kuis-q-letter {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.kuis-result-card {
  text-align: center;
}

.kuis-score {
  display: grid;
  gap: 0.25rem;
  padding: 1.1rem;
  border-radius: 14px;
  background: linear-gradient(155deg, rgba(31, 107, 74, 0.12), transparent 60%), var(--bg);
  border: 1px solid var(--line);
}

.kuis-score-num {
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  font-weight: 800;
  color: var(--brand-dark);
  letter-spacing: 0.02em;
}

.kuis-score-pct {
  color: var(--muted);
  font-weight: 600;
}

@media (max-width: 640px) {
  .kuis-public-card {
    padding: 1.2rem 1rem;
  }

  .kuis-soal-head {
    flex-direction: column;
  }
}

.kuis-soal-item.is-editing {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(31, 107, 74, 0.12);
}

.kuis-play-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.kuis-timer {
  flex: 0 0 auto;
  min-width: 6.5rem;
  text-align: center;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
}

.kuis-timer-label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
}

.kuis-timer-value {
  display: block;
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: var(--brand-dark);
}

.kuis-timer.is-urgent {
  background: var(--danger-soft);
  border-color: #efc2c2;
}

.kuis-timer.is-urgent .kuis-timer-value {
  color: var(--danger);
}

.kuis-finish {
  width: min(720px, 100%);
  display: grid;
  gap: 1rem;
}

.kuis-score-rank {
  display: block;
  margin-top: 0.35rem;
  font-weight: 600;
  color: var(--brand-dark);
}

.kuis-leaderboard {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.kuis-leaderboard li {
  display: grid;
  grid-template-columns: 2.5rem 1fr auto;
  gap: 0.55rem;
  align-items: center;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
}

.kuis-leaderboard li.is-me {
  border-color: var(--brand);
  background: var(--brand-soft);
  font-weight: 650;
}

.kuis-lb-rank {
  color: var(--muted);
  font-weight: 700;
}

.kuis-review-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.kuis-review-item {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
}

.kuis-review-item.is-ok {
  border-color: rgba(31, 107, 74, 0.35);
}

.kuis-review-item.is-bad {
  border-color: rgba(155, 44, 44, 0.28);
}

.kuis-review-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}

.kuis-review-badge {
  flex: 0 0 auto;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.kuis-review-item.is-ok .kuis-review-badge {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.kuis-review-item.is-bad .kuis-review-badge {
  background: var(--danger-soft);
  color: var(--danger);
}

.kuis-review-opsi {
  list-style: none;
  margin: 0.55rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.25rem;
}

.kuis-review-opsi li {
  display: flex;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.kuis-review-opsi li.is-correct {
  color: var(--brand-dark);
  font-weight: 650;
}

.kuis-review-opsi li.is-wrong {
  color: var(--danger);
  text-decoration: line-through;
}

.kuis-review-note {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  .kuis-play-top {
    flex-direction: column;
  }

  .kuis-timer {
    align-self: stretch;
  }
}

.kuis-soal-thumb,
.kuis-q-image,
.kuis-gambar-current img {
  display: block;
  max-width: min(100%, 420px);
  max-height: 240px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  margin: 0.55rem 0;
}

.kuis-gambar-current {
  margin-bottom: 0.5rem;
}

.kuis-join-meta {
  display: grid;
  gap: 0.15rem;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  text-align: center;
}

.kuis-hasil-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.kuis-stat-bar {
  position: relative;
  min-width: 4.5rem;
  height: 1.35rem;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--line);
  overflow: hidden;
}

.kuis-stat-bar span {
  display: block;
  height: 100%;
  background: rgba(155, 44, 44, 0.35);
}

.kuis-stat-bar em {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink);
}

tr.kuis-stat-hot td {
  background: rgba(155, 44, 44, 0.04);
}

.kuis-timers {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.kuis-feedback {
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  margin-bottom: 0.75rem;
}

.kuis-feedback.is-ok {
  background: var(--brand-soft);
  border-color: rgba(31, 107, 74, 0.35);
}

.kuis-feedback.is-bad {
  background: var(--danger-soft);
  border-color: rgba(155, 44, 44, 0.28);
}

.kuis-feedback p {
  margin: 0.35rem 0 0;
}

.btn-icon:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/*  Live multiplayer  */
.live-host-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(220px, 280px) 1fr;
}

@media (max-width: 800px) {
  .live-host-grid {
    grid-template-columns: 1fr;
  }
}

.live-pin-panel {
  text-align: center;
}

.live-pin {
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  font-weight: 800;
  letter-spacing: 0.28em;
  line-height: 1.1;
  margin: 0.5rem 0 0.75rem;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}

.live-pin-input {
  font-size: 1.6rem;
  letter-spacing: 0.35em;
  text-align: center;
  font-weight: 700;
}

.live-host-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.live-peserta-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.live-peserta-list li {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface, #fff);
}

.live-opsi-preview {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.live-opsi-preview li {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.live-opsi-preview li.is-correct {
  background: var(--brand-soft);
  border-color: rgba(31, 107, 74, 0.35);
}

.live-opsi-preview li span:first-child {
  font-weight: 700;
  min-width: 1.25rem;
}

.live-board {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.live-board li {
  display: grid;
  grid-template-columns: 2rem 1fr auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.live-board li.is-me {
  background: var(--brand-soft);
  border-color: rgba(31, 107, 74, 0.35);
}

.live-rank {
  font-weight: 800;
  color: var(--brand);
}

.live-timer {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 0.55rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface, #fff);
  min-width: 5.5rem;
}

.live-play-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.live-wait {
  text-align: center;
  padding: 1.5rem 0;
}

.live-q-options .kuis-q-option {
  cursor: pointer;
}

.live-join .kuis-public-card,
.live-play .kuis-public-card {
  max-width: 40rem;
}
