/* ============================================================
 * Kru Check — page-specific styles + responsive (desktop/iPad)
 * ============================================================ */

/* ---------- login ---------- */
.login-wrap {
  min-height: 100dvh; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 24px var(--page-pad) calc(24px + var(--sab));
  background: linear-gradient(180deg, var(--bg-soft), var(--bg));
}
.login-card { width: 100%; max-width: 400px; }
.login-logo {
  width: 76px; height: 76px; border-radius: 24px; margin: 0 auto 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  color: #fff; display: grid; place-items: center;
  font-size: 34px; font-weight: 800; box-shadow: var(--shadow-lg);
}
.login-title { text-align: center; font-size: 26px; margin-bottom: 2px; }
.login-tagline { text-align: center; color: var(--muted); margin-bottom: 20px; }

/* ---------- dashboard ---------- */
.hello { font-size: var(--fs-xl); margin-bottom: 0; }
.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.quick {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 8px; text-align: center; color: var(--ink);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  min-height: 96px; justify-content: center; font-size: var(--fs-sm); font-weight: 700;
}
.quick:active { transform: scale(0.97); }
.quick__icon {
  width: 44px; height: 44px; border-radius: 14px;
  background: var(--primary-soft); color: var(--primary-deep);
  display: grid; place-items: center;
}
.quick__icon svg { width: 24px; height: 24px; }

/* ---------- scan pages ---------- */
.scan-counter {
  display: flex; align-items: baseline; justify-content: center; gap: 8px;
  margin: 12px 0;
}
.scan-counter b { font-size: var(--fs-2xl); color: var(--primary-deep); }
.student-mode-note {
  background: var(--primary-soft); border-radius: var(--radius-sm);
  padding: 10px 14px; font-size: var(--fs-sm); margin: 12px 0;
  display: flex; justify-content: space-between; gap: 8px;
}

/* ---------- review ---------- */
.review-layout { display: block; }
.review-question {
  font-size: var(--fs-xl); font-weight: 800; text-align: center; margin: 12px 0 4px;
}
.legend { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 10px 0; }
.legend span { font-size: var(--fs-xs); color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }

/* ---------- settings ---------- */
.setting-group { margin-bottom: 18px; }
.setting-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--card); padding: 14px 16px; min-height: 60px;
  border-bottom: 1px solid var(--line); font-weight: 600;
}
.setting-group .setting-row:first-of-type { border-radius: var(--radius) var(--radius) 0 0; }
.setting-group .setting-row:last-of-type { border-radius: 0 0 var(--radius) var(--radius); border-bottom: 0; }
.setting-group .setting-row:only-of-type { border-radius: var(--radius); }
.setting-row small { display: block; font-weight: 400; color: var(--muted); font-size: var(--fs-sm); }

/* ---------- desktop / iPad: sidebar + two-column review ---------- */
@media (min-width: 1024px) {
  :root { --maxw: 1060px; }

  .app-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100dvh; }
  .side-nav {
    position: sticky; top: 0; height: 100dvh;
    background: #fff; border-right: 1px solid var(--line);
    padding: calc(16px + var(--sat)) 12px 16px;
    display: flex; flex-direction: column; gap: 4px;
  }
  .side-nav .brand { padding: 8px 12px 16px; }
  .side-nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; border-radius: var(--radius-sm);
    color: var(--muted); font-weight: 700; font-size: var(--fs-md);
  }
  .side-nav a svg { width: 22px; height: 22px; flex: none; }
  .side-nav a--active, .side-nav a.side-active { background: var(--primary-soft); color: var(--primary-deep); }
  .bottom-nav { display: none; }
  .page { padding-bottom: 48px; }

  /* review: two columns — ซ้าย sticky กระดาษ / ขวา controls */
  .review-layout {
    display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 4fr);
    gap: 20px; align-items: start;
  }
  .review-layout .sheet-stage__sticky { top: 76px; }

  .quick-grid { grid-template-columns: repeat(6, 1fr); }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 700px) and (max-width: 1023px) {
  .quick-grid { grid-template-columns: repeat(3, 1fr); }
}
