
@import url('https://cdn.jsdelivr.net/gh/webfontworld/kakao/KakaoSmall.css');

:root {
  --bg: #f5f5f7;
  --surface: rgba(255,255,255,.78);
  --surface2: rgba(255,255,255,.56);
  --surface3: #eef0f3;
  --border: rgba(15,23,42,.08);
  --border2: rgba(15,23,42,.14);
  --text: #111114;
  --text2: #3b3b40;
  --text3: #6e6e73;
  --accent: #0071e3;
  --accent-light: #e8f3ff;
  --accent-hover: #0062c4;
  --green: #0f9f67;
  --green-light: #e7f8ef;
  --red: #d93025;
  --red-light: #fff1f0;
  --amber: #c77700;
  --amber-light: #fff7e8;
  --sidebar-w: 308px;
  --radius: 18px;
  --radius-lg: 28px;
  --shadow: 0 10px 32px rgba(17,17,20,.06), 0 2px 10px rgba(17,17,20,.04);
  --shadow-md: 0 18px 54px rgba(17,17,20,.12), 0 3px 14px rgba(17,17,20,.05);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'KakaoSmall', sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255,255,255,.92) 0%, rgba(255,255,255,0) 28%),
    radial-gradient(circle at top right, rgba(231,240,255,.92) 0%, rgba(231,240,255,0) 24%),
    linear-gradient(180deg, #fbfbfd 0%, #f2f3f7 48%, #eef1f6 100%);
  color: var(--text);
  font-size: 15.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.16px;
}


.academy-bg-layer,
.academy-bg-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s ease;
}

.academy-bg-layer {
  inset: -40px;
  background-size: cover;
  background-position: center;
  filter: blur(0px) saturate(1.3) brightness(.88);
  transform: scale(1.06);
  z-index: 0;
}

.academy-bg-overlay {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(255,255,255,.22) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 0%, rgba(200,210,255,.14) 0%, transparent 40%),
    radial-gradient(ellipse at 50% 100%, rgba(180,200,255,.12) 0%, transparent 60%),
    linear-gradient(175deg, rgba(245,247,255,.55) 0%, rgba(230,235,250,.38) 60%, rgba(220,228,248,.28) 100%);
  z-index: 0;
}

body.has-academy-bg .academy-bg-layer,
body.has-academy-bg .academy-bg-overlay {
  opacity: 1;
}

a { color: inherit; text-decoration: none; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 99px; }

/* ── Layout ── */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ── Sidebar ── */
.sidebar {
  background: rgba(251,251,253,.72);
  border-right: 1px solid rgba(15,23,42,.06);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  backdrop-filter: blur(28px) saturate(1.2);
  -webkit-backdrop-filter: blur(28px) saturate(1.2);
  box-shadow: inset -1px 0 0 rgba(255,255,255,.65);
}




.brand {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 0 6px;
  margin-bottom: 6px;
  column-gap: 8px;
}

.brand-main {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.brand-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(180deg, #0a84ff 0%, #0066d6 100%);
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 10px 22px rgba(0,113,227,.24);
}

.brand-icon svg { width: 18px; height: 18px; fill: #fff; }

.brand-name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.who {
  font-size: 13px;
  color: var(--text3);
  padding: 0 8px;
  margin-bottom: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.nav-group { margin-bottom: 4px; }

.nav-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text3);
  padding: 0 8px;
  margin-bottom: 6px;
  margin-top: 18px;
}

.nav button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  border: none;
  background: rgba(255,255,255,.38);
  color: var(--text2);
  border-radius: 18px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .16s, color .16s, box-shadow .16s, transform .16s;
  text-align: left;
  margin-bottom: 4px;
  letter-spacing: -.15px;
  border: 1px solid rgba(255,255,255,.46);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}

.nav button .nav-icon {
  width: 20px;
  height: 20px;
  opacity: .65;
  flex-shrink: 0;
}

.nav button.active, .nav button:hover {
  background: rgba(0,113,227,.1);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(0,113,227,.08);
}

body.has-academy-bg .nav button {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.28),
    inset 0 -1px 0 rgba(0,0,0,.04);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  transition: background .18s, color .18s, box-shadow .18s, border-color .18s;
}

body.has-academy-bg .nav button.active,
body.has-academy-bg .nav button:hover {
  background: linear-gradient(
    155deg,
    rgba(255,255,255,.72) 0%,
    rgba(255,255,255,.48) 100%
  );
  color: var(--accent);
  border-color: rgba(255,255,255,.62);
  box-shadow:
    inset 0 1.5px 0 rgba(255,255,255,.95),
    inset 1px 0 0 rgba(255,255,255,.3),
    0 10px 28px rgba(50, 70, 140, .18),
    0 3px 8px rgba(50, 70, 140, .1);
}

.nav button.active .nav-icon,
.nav button:hover .nav-icon { opacity: 1; }



.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 10px 8px;
}

.logout-btn {
  margin-top: auto !important;
  color: var(--red) !important;
}
.logout-btn:hover { background: var(--red-light) !important; }

/* ── Sidebar collapse ── */
.shell { transition: grid-template-columns .28s cubic-bezier(.4,0,.2,1); }
.shell.nav-collapsed { grid-template-columns: 64px 1fr; }
.shell.nav-collapsed .sidebar { padding: 20px 8px; overflow: hidden; align-items: center; }
.shell.nav-collapsed .brand-name,
.shell.nav-collapsed .who,
.shell.nav-collapsed #academyLabel,
.shell.nav-collapsed .nav-label,
.shell.nav-collapsed .nav-text { display: none; }
.shell.nav-collapsed .nav button { justify-content: center; padding: 10px; width: 44px; margin: 0 auto 2px; }
.shell.nav-collapsed .nav button .nav-icon { opacity: .7; }
.shell.nav-collapsed .nav button.active .nav-icon,
.shell.nav-collapsed .nav button:hover .nav-icon { opacity: 1; }
.shell.nav-collapsed .brand { grid-template-columns: 1fr; justify-items: center; row-gap: 8px; padding: 0; }
.shell.nav-collapsed .brand-main { justify-content: center; }
.shell.nav-collapsed .brand-collapse-btn svg { transform: rotate(180deg); }
.shell.nav-collapsed .nav-divider { width: 36px; }
.shell.nav-collapsed .logout-btn { width: 44px; margin: auto auto 0; padding: 10px; justify-content: center; }
.shell.nav-collapsed .brand-collapse-btn { margin: 0 auto; }
.shell.nav-collapsed .sidebar-plan-card { display: none; }
.nav-text { }
.brand-collapse-btn {
  width: 28px; height: 28px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border: none; background: transparent; border-radius: 8px;
  color: var(--text3); cursor: pointer;
  transition: background .15s, color .15s;
}
.brand-collapse-btn:hover { background: var(--surface3); color: var(--text2); }
.brand-collapse-btn svg { width: 16px; height: 16px; transition: transform .28s cubic-bezier(.4,0,.2,1); }

.sidebar-plan-card {
  margin: 10px 8px 12px;
  padding: 14px 14px 13px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.95) 0%, rgba(230,236,247,.96) 20%, rgba(255,255,255,.92) 42%, rgba(214,223,240,.98) 62%, rgba(248,251,255,.96) 100%);
  border: 1px solid rgba(201,210,229,.9);
  border-radius: 14px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.9),
    inset 0 -1px 0 rgba(126,141,178,.12),
    0 8px 20px rgba(80,96,132,.12),
    0 2px 6px rgba(15,22,45,.08);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --lift-y: 0px;
  transform: perspective(980px) rotateX(var(--tilt-y)) rotateY(var(--tilt-x)) translate3d(0, var(--lift-y), 0);
  transition: transform .14s ease, box-shadow .2s ease, border-color .18s ease, background .18s ease, filter .18s ease;
}

.sidebar-plan-card::before,
.sidebar-plan-card::after {
  content: "";
  position: absolute;
  pointer-events: none;
  inset: 0;
  transition: opacity .18s ease;
}

.sidebar-plan-card::before {
  background:
    linear-gradient(160deg, rgba(255,255,255,.64) 0%, rgba(255,255,255,.22) 18%, rgba(255,255,255,0) 42%),
    linear-gradient(0deg, rgba(255,255,255,.16) 0%, rgba(255,255,255,0) 34%);
  mix-blend-mode: screen;
  opacity: .36;
  transform: translate3d(calc(var(--tilt-x) * -1.4), calc(var(--tilt-y) * -1.2), 0);
}

.sidebar-plan-card::after {
  background:
    linear-gradient(110deg, rgba(255,255,255,0) 12%, rgba(255,255,255,.08) 34%, rgba(255,255,255,.2) 48%, rgba(255,255,255,.08) 62%, rgba(255,255,255,0) 84%),
    linear-gradient(220deg, rgba(93,128,255,.12) 0%, rgba(93,128,255,0) 36%),
    linear-gradient(28deg, rgba(255,211,143,.1) 0%, rgba(255,211,143,0) 30%);
  opacity: .26;
  transform: translate3d(calc(var(--tilt-x) * .9), calc(var(--tilt-y) * .8), 0);
}

.sidebar-plan-card:hover {
  border-color: rgba(189,201,229,.95);
  --lift-y: -10px;
  filter: saturate(1.05) brightness(1.02);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.95),
    inset 0 -1px 0 rgba(126,141,178,.18),
    0 22px 34px rgba(63,78,114,.2),
    0 28px 52px rgba(15,22,45,.22),
    0 10px 14px rgba(15,22,45,.12);
}

.sidebar-plan-card:hover::before,
.sidebar-plan-card:hover::after {
  opacity: 1;
}

.sidebar-plan-card > * {
  position: relative;
  z-index: 1;
}

.sidebar-plan-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--text3);
  letter-spacing: .02em;
  margin-bottom: 8px;
}

.sidebar-plan-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.25px;
}

.sidebar-plan-meta {
  margin-top: 4px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text3);
}

.sidebar-plan-track {
  width: 100%;
  height: 8px;
  margin-top: 11px;
  border-radius: 999px;
  overflow: hidden;
  background: #e7ebf5;
}

.sidebar-plan-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3b5bff 0%, #6f86ff 100%);
}

.sidebar-plan-caption {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text3);
}

.folder-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.folder-group {
  border: 1px solid #d9e4ff;
  border-radius: 16px;
  background: linear-gradient(180deg, #f7faff 0%, #eef4ff 100%);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.folder-toggle {
  width: 100%;
  border: none;
  background: transparent;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.folder-toggle:hover {
  background: rgba(59, 91, 255, .08);
}

.folder-toggle-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.folder-texts {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.folder-chevron {
  width: 18px;
  height: 18px;
  color: var(--text3);
  transition: transform .18s ease;
  flex-shrink: 0;
}

.folder-group.open .folder-chevron {
  transform: rotate(90deg);
}

.folder-title {
  font-size: 15px;
  font-weight: 800;
  color: #2143b9;
  letter-spacing: -.2px;
}

.folder-meta {
  font-size: 12px;
  font-weight: 700;
  color: #5d76c8;
  white-space: nowrap;
}

.folder-body {
  display: none;
  border-top: 1px solid #d9e4ff;
  padding: 8px 14px 14px;
  background: #fdfefe;
}

.folder-group.open .folder-body {
  display: block;
}

.folder-empty {
  padding: 18px 14px;
  text-align: center;
  color: var(--text3);
  font-size: 13px;
}

.folder-admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 16px;
  padding: 16px 14px;
  border-radius: 14px;
  background: #ffffff;
}

.folder-admin-row + .folder-admin-row {
  border-top: 1px solid #e7edf7;
}

.folder-admin-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.folder-admin-name {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}

.folder-admin-email {
  margin-top: 4px;
  font-size: 13px;
  color: #64748b;
  word-break: break-all;
}

.folder-admin-actions {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-shrink: 0;
}

/* ── Main ── */
.main {
  min-width: 0;
  overflow-x: clip;
  overflow-x: hidden;
}

.panel { display: none; }
.panel.active { display: block; }
.panel-inner { padding: 0 32px 32px; }

/* ── Page Header ── */
.page-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(245,245,247,.72);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 24px 0 16px;
  margin-bottom: 16px;
  margin-left: -32px;
  margin-right: -32px;
  padding-left: 32px;
  padding-right: 32px;
  border-bottom: 1px solid rgba(15,23,42,.06);
  backdrop-filter: blur(26px) saturate(1.2);
  -webkit-backdrop-filter: blur(26px) saturate(1.2);
  border-bottom-left-radius: 28px;
  border-bottom-right-radius: 28px;
  box-shadow: 0 8px 24px rgba(17,17,20,.05);
}



body.has-academy-bg .page-header {
  background:
    linear-gradient(180deg, rgba(248,250,255,.78) 0%, rgba(240,244,255,.58) 100%);
  backdrop-filter: blur(44px) saturate(1.8) brightness(1.04);
  -webkit-backdrop-filter: blur(44px) saturate(1.8) brightness(1.04);
  border-bottom-color: rgba(255,255,255,.45);
  box-shadow:
    inset 0 1.5px 0 rgba(255,255,255,.85),
    0 6px 24px rgba(30, 42, 100, .1);
}

@media (max-width: 1100px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .metrics { grid-template-columns: 1fr; }
  .panel-inner { padding: 12px 16px 24px; }
  .page-header {
    padding-top: 16px;
    padding-bottom: 12px;
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 16px;
    padding-right: 16px;
  }
}
@media (max-width: 768px) {
  .panel-inner { padding: 12px 10px 18px; }
  .page-header {
    top: 52px;
    margin-left: -10px;
    margin-right: -10px;
    padding-left: 10px;
    padding-right: 10px;
  }
}

.page-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.8px;
  color: var(--text);
}

.page-desc {
  font-size: 14.5px;
  color: var(--text3);
  margin-top: 5px;
  letter-spacing: -.1px;
}

/* ── Metric Cards ── */
.metrics {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 24px;
}

.metric-card {
  background: linear-gradient(180deg, rgba(255,255,255,.88) 0%, rgba(255,255,255,.72) 100%);
  border: 1px solid rgba(255,255,255,.74);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px) saturate(1.15);
  -webkit-backdrop-filter: blur(20px) saturate(1.15);
  cursor: default;
}



.metric-card.metric-link { cursor: pointer; }

.dashboard-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.dashboard-layout-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dashboard-layout-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
  grid-auto-flow: dense;
  grid-auto-rows: 14px;
  align-items: stretch;
}

.dashboard-layout-grid::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity .18s ease;
  border-radius: 24px;
  background-image:
    linear-gradient(to right, rgba(79,110,255,.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(79,110,255,.06) 1px, transparent 1px);
  background-size: calc((100% - 11 * 18px) / 12 + 18px) 32px;
  background-position: 0 0;
}

.dashboard-widget {
  position: relative;
  min-width: 0;
  transition: transform .18s ease, box-shadow .18s ease;
}

@keyframes dashboardWidgetWiggle {
  0% { transform: rotate(-.45deg); }
  50% { transform: rotate(.45deg); }
  100% { transform: rotate(-.45deg); }
}

.dashboard-widget-inner {
  height: 100%;
}

.dashboard-widget .card,
.dashboard-widget .metric-card {
  height: 100%;
  margin: 0;
}

.dashboard-widget-chrome {
  display: none;
}

.dashboard-widget-tools {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dashboard-widget-drag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,.28);
  background: rgba(255,255,255,.88);
  color: var(--text2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  box-shadow: 0 10px 24px rgba(15,23,42,.08);
  cursor: grab;
  user-select: none;
}

.dashboard-widget-drag svg {
  width: 12px;
  height: 12px;
}

.dashboard-widget-preset {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,.26);
  background: rgba(255,255,255,.92);
  box-shadow: 0 10px 24px rgba(15,23,42,.08);
}

.dashboard-widget-preset button {
  border: 0;
  background: transparent;
  color: var(--text3);
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .04em;
  cursor: pointer;
}

.dashboard-widget-preset button.active {
  background: rgba(79,110,255,.14);
  color: var(--accent);
}

.dashboard-widget-lock {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid rgba(148,163,184,.26);
  background: rgba(255,255,255,.92);
  box-shadow: 0 10px 24px rgba(15,23,42,.08);
  color: var(--text2);
  cursor: pointer;
}

.dashboard-widget-lock svg {
  width: 14px;
  height: 14px;
}

.dashboard-widget-resize {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 8;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  border: 1px solid rgba(148,163,184,.26);
  background: rgba(255,255,255,.92);
  box-shadow: 0 10px 24px rgba(15,23,42,.08);
  cursor: nwse-resize;
}

.dashboard-widget-resize::before {
  content: "";
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 11px;
  height: 11px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  opacity: .9;
}

.dashboard-layout-grid.editing .dashboard-widget {
  cursor: default;
  animation: dashboardWidgetWiggle .26s ease-in-out infinite alternate;
  transform-origin: 50% 18%;
}

.dashboard-layout-grid.editing::before {
  opacity: 1;
}

.dashboard-layout-grid.editing .dashboard-widget-chrome {
  display: block;
}

.dashboard-layout-grid.editing .dashboard-widget-inner {
  pointer-events: none;
}

.dashboard-layout-grid.editing .dashboard-widget.is-dragging {
  opacity: .72;
  animation: none;
  transform: scale(.985);
}

.dashboard-layout-grid.editing .dashboard-widget.drop-target {
  transform: translateY(-4px);
}

.dashboard-layout-grid.editing .dashboard-widget.drop-before::before,
.dashboard-layout-grid.editing .dashboard-widget.drop-after::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(79,110,255,.85), rgba(128,149,255,.88));
  box-shadow: 0 10px 24px rgba(79,110,255,.24);
  z-index: 7;
}

.dashboard-layout-grid.editing .dashboard-widget.drop-before::before {
  top: -9px;
}

.dashboard-layout-grid.editing .dashboard-widget.drop-after::after {
  bottom: -9px;
}

.dashboard-layout-grid.editing .dashboard-widget .card,
.dashboard-layout-grid.editing .dashboard-widget .metric-card {
  box-shadow: 0 0 0 2px rgba(79,110,255,.2), var(--shadow);
}

.dashboard-layout-grid.editing .dashboard-widget.is-locked .card,
.dashboard-layout-grid.editing .dashboard-widget.is-locked .metric-card {
  box-shadow: 0 0 0 2px rgba(148,163,184,.16), var(--shadow);
  opacity: .86;
}

.dashboard-layout-grid.editing .dashboard-widget.is-locked .dashboard-widget-drag,
.dashboard-layout-grid.editing .dashboard-widget.is-locked .dashboard-widget-resize,
.dashboard-layout-grid.editing .dashboard-widget.is-locked .dashboard-widget-preset {
  opacity: .45;
  cursor: not-allowed;
}

.dashboard-layout-grid.editing .dashboard-widget.is-locked .dashboard-widget-lock {
  color: var(--accent);
  border-color: rgba(79,110,255,.2);
}

.dashboard-edit-note {
  font-size: 12px;
  font-weight: 600;
  color: var(--text3);
}

.dashboard-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .95fr);
  gap: 18px;
  align-items: start;
}

.dashboard-side-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.dashboard-card-body {
  padding: 0 22px 18px;
}

.dashboard-card-body.compact {
  padding-bottom: 16px;
}

.dashboard-section-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 6px;
}
.progress-capture-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 248px;
  gap: 14px;
  align-items: start;
}
.progress-summary-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}
.progress-summary-card {
  background: linear-gradient(180deg, rgba(255,255,255,.92) 0%, rgba(255,255,255,.76) 100%);
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 20px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
}
.progress-summary-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 8px;
}
.progress-summary-value {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -.5px;
  color: var(--text);
  line-height: 1.1;
}
.progress-summary-sub {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text3);
}
.progress-subject-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}
.progress-subject-item {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.progress-subject-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.progress-subject-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.2px;
}
.progress-subject-meta {
  font-size: 12px;
  font-weight: 700;
  color: var(--text3);
  flex-shrink: 0;
}
.progress-subject-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(226,232,240,.8);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(15,23,42,.06);
}
.progress-subject-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7c9dff 0%, #4f6eff 55%, #3554f6 100%);
}
.progress-table-card .table-wrap {
  border-top: 1px solid var(--border);
}
.progress-row-title {
  max-width: 320px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.6;
  color: var(--text);
  white-space: normal;
  word-break: break-word;
}
.progress-row-note {
  max-width: 240px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text2);
  white-space: normal;
  word-break: break-word;
}
.progress-capture-footer {
  display: none;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 4px 0;
}
.progress-capture-brand {
  min-width: 240px;
  max-width: 44%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  flex-shrink: 0;
}
.progress-capture-academy {
  font-size: 24px;
  font-weight: 900;
  line-height: 1.1;
  color: var(--text);
  letter-spacing: -.5px;
  white-space: normal;
  word-break: keep-all;
}
.progress-capture-brand-sub {
  margin-top: 5px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
  color: #98a2b3;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.progress-capture-label {
  flex: 1;
  min-width: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.35;
  color: var(--text2);
  box-shadow: var(--shadow);
  text-align: right;
  word-break: keep-all;
}
.grade-chart-modal-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 28px 28px 24px;
}
.grade-chart-empty {
  text-align: center;
  padding: 52px 0;
  color: var(--text3);
  font-size: 15px;
}
.grade-sheet-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}
.grade-sheet-table th,
.grade-sheet-table td {
  vertical-align: top;
}
.grade-sheet-group-start {
  border-left: 2px solid var(--border2);
}
.grade-sheet-group-head {
  font-size: 13px;
  font-weight: 800;
  color: var(--text2);
  background: linear-gradient(180deg, #fbfcff 0%, #f3f6fd 100%);
  padding-top: 14px !important;
  padding-bottom: 14px !important;
}
.grade-sheet-subhead {
  font-size: 11px;
  color: var(--text3);
  font-weight: 700;
  text-align: center;
  background: #f7f9fd;
  padding-top: 12px !important;
  padding-bottom: 12px !important;
}
.grade-admin-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.grade-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.grade-filter-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.grade-filter-group .input {
  min-width: 180px;
}
.grade-sheet-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 320px);
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(247,249,253,.95) 0%, rgba(241,244,251,.85) 100%);
  border: 1px solid rgba(148, 163, 184, 0.14);
}
.grade-sheet-hint {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text3);
}
.grade-sheet-select {
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-self: end;
  width: 100%;
}
.grade-sheet-select-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text3);
}
.grade-sheet-select .input {
  width: 100%;
}
.grade-sheet-wrap {
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 22px;
  overflow: auto;
  background: rgba(255,255,255,.72);
}
.grade-sheet-wrap .tbl thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}
.grade-sheet-student {
  width: 156px;
  min-width: 156px;
  background: #fbfcff;
}
.grade-sheet-table thead .grade-sheet-student {
  position: sticky;
  left: 0;
  z-index: 3;
}
.grade-sheet-table tbody .grade-sheet-student {
  position: sticky;
  left: 0;
  z-index: 2;
  box-shadow: 10px 0 18px rgba(148, 163, 184, 0.08);
}
.grade-score-cell {
  min-width: 132px;
  background: #fff;
}
.grade-score-field {
  display: grid;
  gap: 8px;
  align-items: start;
}
.grade-score-label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 11px;
  background: linear-gradient(180deg, #f4f7ff 0%, #edf2fb 100%);
  border: 1px solid #dde5f5;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--text2);
  line-height: 1.35;
  word-break: keep-all;
  text-align: center;
}
.grade-score-input {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 8px 10px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}
.grade-percentile-cell {
  min-width: 96px;
  background: #fcfdff;
}
.grade-percentile-cell .grade-score-input {
  width: 100%;
}
.grade-sheet-group-start {
  border-left: 3px solid #d7dff2;
}
.grade-sheet-table tbody tr:nth-child(even) .grade-score-cell,
.grade-sheet-table tbody tr:nth-child(even) .grade-percentile-cell,
.grade-sheet-table tbody tr:nth-child(even) .grade-sheet-student {
  background: #fbfcff;
}
.grade-sheet-action-cell,
.grade-sheet-manage-head {
  width: 92px;
  min-width: 92px;
  text-align: center;
  background: #fbfcff;
}
.grade-sheet-action-cell {
  vertical-align: middle;
}
.exam-setup-card {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(250,251,255,.96) 0%, rgba(245,247,252,.88) 100%);
  padding: 18px 18px 16px;
}
.exam-setup-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.exam-setup-toolbar .field {
  margin: 0;
}
.exam-setup-table {
  width: 100%;
  max-width: 520px;
}
.exam-setup-table th,
.exam-setup-table td {
  vertical-align: middle;
}
.exam-setup-qno {
  width: 72px;
  min-width: 72px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--text2);
}
.exam-setup-answer-input,
.exam-setup-score-input {
  text-align: center;
  font-weight: 700;
}
.exam-setup-answer-input {
  width: 100%;
  min-width: 100px;
}
.exam-setup-score-input {
  width: 100%;
  min-width: 86px;
}

.metric-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text3);
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.metric-value {
  font-size: 34px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.8px;
  line-height: 1.05;
  font-family: 'KakaoSmall', sans-serif;
}

.metric-icon {
  width: 36px;
  height: 36px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
}

.metric-icon.blue { background: var(--accent-light); color: var(--accent); }
.metric-icon.green { background: var(--green-light); color: var(--green); }
.metric-icon.amber { background: var(--amber-light); color: var(--amber); }
.metric-icon.red { background: var(--red-light); color: var(--red); }

/* ── Cards ── */
.card {
  background: linear-gradient(180deg, rgba(255,255,255,.9) 0%, rgba(255,255,255,.76) 100%);
  border: 1px solid rgba(255,255,255,.78);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(18px) saturate(1.12);
  -webkit-backdrop-filter: blur(18px) saturate(1.12);
}

.card-header {
  padding: 24px 28px 6px;
}

.card-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.35px;
}

.card-body { padding: 20px 26px 24px; }

.subject-progress-card {
  background: linear-gradient(180deg, rgba(255,255,255,.92) 0%, rgba(255,255,255,.76) 100%);
  border: 1px solid rgba(255,255,255,.76);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 14px 14px 12px;
  backdrop-filter: blur(16px) saturate(1.08);
  -webkit-backdrop-filter: blur(16px) saturate(1.08);
}

.subject-progress-card.active {
  border-color: #cdd8ff;
  box-shadow: 0 4px 16px rgba(59,91,255,.08);
}

.subject-progress-card.done {
  border-color: #b8ecd4;
  background: linear-gradient(180deg, #ffffff 0%, #f2fff9 100%);
}

.subject-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.subject-progress-label {
  min-width: 0;
}

.subject-progress-label .subject-chip {
  max-width: 100%;
}

.subject-progress-value {
  flex-shrink: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.4px;
}

.subject-progress-track {
  width: 100%;
  height: 8px;
  background: #e8edf9;
  border-radius: 999px;
  overflow: hidden;
}

.subject-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3b5bff 0%, #6f86ff 100%);
}

.subject-progress-card.done .subject-progress-fill {
  background: linear-gradient(90deg, #0faa6a 0%, #3ad08d 100%);
}

.subject-progress-meta {
  margin-top: 9px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text3);
}

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }

/* ── Form Inputs ── */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }

.field label {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text2);
  letter-spacing: -.1px;
}

input.input, select.input, textarea.input {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid rgba(15,23,42,.1);
  border-radius: 14px;
  background: rgba(255,255,255,.76);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  transition: border-color .16s, box-shadow .16s, background .16s;
  outline: none;
  appearance: none;
  letter-spacing: -.1px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85);
}

input.input:focus, select.input:focus, textarea.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(0,113,227,.12);
  background: rgba(255,255,255,.96);
}


textarea.input { min-height: 88px; resize: vertical; }

select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b92a8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 18px;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background .16s, transform .12s, box-shadow .16s, border-color .16s, color .16s;
  white-space: nowrap;
  letter-spacing: -.1px;
}

.btn:active { transform: scale(.98); }

.btn-primary {
  background: linear-gradient(180deg, #0a84ff 0%, #0071e3 100%);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 10px 24px rgba(0,113,227,.24);
}
.btn-primary:hover { background: linear-gradient(180deg, #1990ff 0%, #0077ed 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 12px 28px rgba(0,113,227,.28); }

.btn-secondary {
  background: rgba(255,255,255,.74);
  color: var(--text2);
  border: 1px solid rgba(15,23,42,.1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.82);
}
.btn-secondary:hover { background: rgba(255,255,255,.9); border-color: rgba(15,23,42,.14); }

.btn-danger { background: #fff2f1; color: var(--red); border: 1px solid rgba(217,48,37,.16); }
.btn-danger:hover { background: #ffe8e6; }

.btn-success { background: var(--green-light); color: var(--green); border: 1px solid rgba(15,159,103,.18); }
.btn-success:hover { background: #d1faea; }


.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 999px; }
.btn-full { width: 100%; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.filter-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.selection-action-bar {
  display: none;
  position: sticky;
  top: 78px;
  z-index: 55;
  margin: -4px 0 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  box-shadow: 0 10px 26px rgba(245, 158, 11, .12);
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.selection-action-bar.open {
  display: flex;
}

.assignment-row-selected td {
  background: #eef4ff !important;
}

.filter-toolbar input.input,
.filter-toolbar select.input {
  width: auto;
  flex: 0 0 auto;
}

.student-task-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 22px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(255,255,255,.78);
  box-shadow: 0 8px 24px rgba(17,17,20,.06);
  backdrop-filter: blur(18px) saturate(1.12);
  -webkit-backdrop-filter: blur(18px) saturate(1.12);
}

.student-task-toolbar input.input {
  width: 172px;
  min-width: 172px;
  background: #fff;
}

.student-task-toolbar .btn {
  min-width: 96px;
}

.student-attachment-btn {
  background: #eef6ff;
  color: #0066cc;
  border: 1px solid rgba(0,113,227,.16);
  font-weight: 800;
}

/* ── Table ── */
.table-wrap { overflow-x: auto; }

table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

table.tbl thead th {
  padding: 13px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text3);
  background: rgba(248,248,250,.82);
  border-bottom: 1px solid rgba(15,23,42,.06);
  white-space: nowrap;
}

table.tbl tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}

table.tbl tbody tr:last-child { border-bottom: none; }
table.tbl tbody tr:hover { background: rgba(0,113,227,.045); }

table.tbl tbody td {
  padding: 13px 16px;
  color: var(--text2);
  vertical-align: middle;
  letter-spacing: -.1px;
}

table.tbl tbody td:first-child { color: var(--text3); font-family: 'KakaoSmall', sans-serif; font-size: 13px; font-weight: 600; }

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 11px;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: -.05px;
}

.badge-blue { background: var(--accent-light); color: var(--accent); }
.badge-green { background: var(--green-light); color: var(--green); }
.badge-red { background: var(--red-light); color: var(--red); }
.badge-amber { background: var(--amber-light); color: var(--amber); }
.badge-gray { background: var(--surface3); color: var(--text3); }
/* subject badges */
.badge-subj-korean  { background: #fef0f2; color: #c41e3a; }
.badge-subj-math    { background: #e6fbf3; color: #0a7a4e; }
.badge-subj-english { background: #fefce8; color: #a16207; }
.badge-subj-science { background: #eef0ff; color: #3b5bff; }
.badge-subj-social  { background: #fff4e6; color: #c2410c; }
.badge-subj-other   { background: var(--surface3); color: var(--text2); }

/* ── Section Divider ── */
.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--text2);
  letter-spacing: -.2px;
}

/* ── Login Page ── */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--bg);
  padding: 20px;
}

.login-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px;
  box-shadow: var(--shadow-md);
}

.login-logo {
  width: 48px;
  height: 48px;
  background: var(--accent);
  border-radius: 14px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
}

.login-logo svg { width: 24px; height: 24px; fill: #fff; }

.login-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: .08em;
  margin-bottom: 6px;
}

.login-sub {
  font-size: 15px;
  color: var(--text3);
  margin-bottom: 30px;
  letter-spacing: -.1px;
}

.login-form .field { margin-bottom: 16px; }
.login-msg { font-size: 13.5px; color: var(--red); margin-top: 12px; min-height: 20px; font-weight: 600; }

/* ── Inline filter/sort row ── */
.filter-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}

.filter-row select.input { max-width: 200px; }

.student-mobile-only { display: none !important; }

/* ── Misc ── */
.hidden { display: none !important; }
.text-muted { color: var(--text3); font-size: 13.5px; }
.mono { font-family: 'KakaoSmall', sans-serif; }

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text3);
}
.empty-state svg { width: 40px; height: 40px; opacity: .3; margin-bottom: 12px; }
.empty-state p { font-size: 14.5px; }

/* ── Mobile top bar ── */
.mobile-topbar {
  display: none;
  align-items: center; gap: 12px;
  padding: 0 16px; height: 52px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 150;
}
.mobile-topbar .m-brand { font-size: 17px; font-weight: 800; color: var(--text); letter-spacing: .08em; }
.mobile-hamburger {
  width: 36px; height: 36px; border: none; background: transparent;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  border-radius: 8px; color: var(--text2); flex-shrink: 0;
  transition: background .15s;
}
.mobile-hamburger:hover { background: var(--surface3); }
.mobile-hamburger svg { width: 20px; height: 20px; }

/* ── Mobile overlay backdrop ── */
.mobile-nav-backdrop {
  display: none;
  position: fixed; inset: 0; z-index: 190;
  background: rgba(10,16,38,.45);
  backdrop-filter: blur(2px);
  opacity: 0; transition: opacity .25s;
}
.shell.mobile-nav-open .mobile-nav-backdrop {
  display: block; opacity: 1;
}


@media (max-width: 1100px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .metrics { grid-template-columns: 1fr; }
  .panel-inner { padding: 12px 16px 24px; }
  .page-header {
    padding-top: 16px;
    padding-bottom: 12px;
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 16px;
    padding-right: 16px;
  }
}
@media (max-width: 768px) {
  .shell { display: block; }
  body { font-size: 14px; }
  .mobile-topbar { display: flex; padding: 0 12px; height: 48px; gap: 10px; }
  .mobile-topbar .m-brand { font-size: 15px; letter-spacing: .08em; }
  .mobile-hamburger { width: 34px; height: 34px; }
  .main { min-height: calc(100vh - 52px); }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 200;
    width: 270px !important; height: 100vh;
    transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    box-shadow: 4px 0 24px rgba(10,16,38,.18);
    overflow-y: auto;
    padding: 18px 12px;
  }
  .shell.nav-collapsed .sidebar { transform: translateX(-100%); }
  .shell.mobile-nav-open .sidebar { transform: translateX(0); }
  .brand-collapse-btn { display: none; }
  .sidebar-plan-card { display: none; }
  .brand { padding: 0 4px; margin-bottom: 4px; }
  .brand-icon { width: 30px; height: 30px; border-radius: 9px; }
  .brand-icon svg { width: 16px; height: 16px; }
  .brand-name { font-size: 14px; letter-spacing: .04em; }
  .who { font-size: 12px; padding: 0 4px; margin-bottom: 10px; }
  #academyLabel { padding: 2px 4px 8px !important; font-size: 11px !important; }
  .nav-label { padding: 0 4px; margin-top: 12px; margin-bottom: 4px; font-size: 10px; }
  .nav button { padding: 9px 10px; gap: 9px; font-size: 14px; border-radius: 11px; }
  .nav button .nav-icon { width: 18px; height: 18px; }
  .nav-divider { margin: 8px 4px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .card { border-radius: 16px; }
  .card-header { padding: 14px 16px 2px; }
  .card-title { font-size: 15px; }
  .card-body { padding: 12px 16px 16px; }
  .page-title { font-size: 20px; letter-spacing: -.45px; }
  .page-desc { font-size: 12.5px; margin-top: 3px; }
  .metric-card { padding: 14px 14px 12px; border-radius: 18px; }
  .progress-capture-layout { grid-template-columns: 1fr; }
  .progress-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .metric-label { font-size: 11px; margin-bottom: 8px; }
  .metric-value { font-size: 24px; }
  .metric-icon { width: 30px; height: 30px; border-radius: 11px; margin-bottom: 10px; }
  .modal-box { width: 100% !important; border-radius: 22px 22px 0 0 !important; }
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal-header { padding: 14px 16px; }
  .modal-title { font-size: 16px; }
  .modal-body { padding: 16px; }
  .modal-footer { padding: 12px 16px 16px; gap: 8px; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tbl th, .tbl td { padding: 10px 10px; font-size: 12.5px; }
  .tbl th { white-space: nowrap; }
  .btn-row, .filter-toolbar { flex-wrap: wrap; gap: 6px; }
  .btn, .input, input.input, select.input, textarea.input { font-size: 13px; }
  .btn { padding: 11px 12px; border-radius: 12px; }
  .btn.btn-sm { padding: 7px 10px; font-size: 12px; }
  .field { gap: 5px; margin-bottom: 10px; }
  .field label { font-size: 12px; }
  input.input, select.input, textarea.input { padding: 10px 12px; border-radius: 12px; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 8px; top: 48px; }
  .page-header > div:last-child { width: 100%; }
  .page-header > div:last-child .btn,
  .page-header > div:last-child .input,
  .page-header > div:last-child select,
  .page-header > div:last-child .filter-toolbar .btn,
  .page-header > div:last-child .filter-toolbar .input,
  .page-header > div:last-child .filter-toolbar select { width: 100%; max-width: none !important; }
  .student-desktop-only { display: none !important; }
  .student-mobile-only { display: block !important; }
  .subject-progress-card { padding: 12px; border-radius: 14px; }
  .subject-progress-value { font-size: 16px; }
  .subject-progress-meta { font-size: 11.5px; }
  .empty-state { padding: 28px 16px; }
  .empty-state p { font-size: 13px; }
  #studentAssignmentsCard { display: none; }
  .dashboard-layout-grid { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .dashboard-widget { grid-column: 1 / -1 !important; grid-row: auto !important; }
  .dashboard-widget-chrome { display: none !important; }
  .dashboard-layout-toolbar { width: 100%; }
  .dashboard-main-grid { grid-template-columns: 1fr; }
  .dashboard-card-body { padding: 0 16px 16px; }
  .progress-capture-footer { flex-direction: column; align-items: stretch; }
  .progress-capture-brand { max-width: 100%; min-width: 0; }
  .progress-capture-label { text-align: left; }
}

@media (min-width: 769px) and (max-width: 1024px) {
  :root { --sidebar-w: 200px; }
  .panel-inner { padding: 0 20px 24px; }
  .page-header {
    margin-left: -20px;
    margin-right: -20px;
    padding-left: 20px;
    padding-right: 20px;
  }
  .metrics { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 769px) {
  .mobile-nav-backdrop { display: none !important; }
}

/* ── Toggle Switch (SMS) ── */
.sw-wrap { display:flex; align-items:center; gap:10px; }
.sw { position:relative; width:44px; height:24px; flex-shrink:0; }
.sw input { opacity:0; width:0; height:0; }
.sw-slider { position:absolute; cursor:pointer; inset:0; background:var(--border2); border-radius:99px; transition:.2s; }
.sw-slider:before { content:''; position:absolute; width:18px; height:18px; left:3px; top:3px; background:#fff; border-radius:50%; transition:.2s; }
.sw input:checked + .sw-slider { background:var(--accent); }
.sw input:checked + .sw-slider:before { transform:translateX(20px); }

/* ── Modal ── */
@keyframes _modal-bg-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes _modal-bg-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes _modal-in  { from { opacity: 0; transform: translateY(28px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes _modal-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(14px) scale(.97); } }
.modal-backdrop {
  display: none;
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(17,17,20,.24);
  align-items: center; justify-content: center;
  padding: 20px;
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
}

body.has-academy-bg .modal-backdrop {
  background: rgba(20,30,60,.32);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
}
.modal-backdrop.open {
  display: flex;
  animation: _modal-bg-in .2s ease forwards;
}
.modal-backdrop.open .modal-box {
  animation: _modal-in .24s cubic-bezier(.16,1,.3,1) forwards;
}
.modal-backdrop.closing {
  display: flex;
  animation: _modal-bg-out .18s ease forwards;
  pointer-events: none;
}
.modal-backdrop.closing .modal-box {
  animation: _modal-out .18s ease forwards;
}
.modal-box {
  background: linear-gradient(180deg, rgba(255,255,255,.92) 0%, rgba(255,255,255,.78) 100%);
  border: 1px solid rgba(255,255,255,.84);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  width: min(820px, 96vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(22px) saturate(1.18);
  -webkit-backdrop-filter: blur(22px) saturate(1.18);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 28px; border-bottom: 1px solid rgba(15,23,42,.06); flex-shrink: 0;
}
.modal-title { font-size: 19px; font-weight: 800; color: var(--text); letter-spacing: -.35px; }
.modal-close {
  background: none; border: none; cursor: pointer; color: var(--text3);
  font-size: 22px; line-height: 1; padding: 4px 10px; border-radius: 10px;
  transition: background .15s;
}
.modal-close:hover { background: var(--surface3); color: var(--text); }
.modal-body { padding: 26px 28px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 16px 28px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px; flex-shrink: 0;
}

/* ── Required star ── */
.required-star { color:var(--red); margin-left:2px; }

/* ── QR scan animation ── */
@keyframes qrScanAnim { 0%{top:10%} 50%{top:85%} 100%{top:10%} }
@keyframes scanLine { 0%{top:6%} 50%{top:88%} 100%{top:6%} }

/* ── Live pulse dot ── */
@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .35; transform: scale(.85); }
}
.live-dot {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(15,170,106,.55);
  animation: livePulse 1.4s ease-in-out infinite;
  vertical-align: middle;
  margin-right: 7px;
}
@keyframes liveRowFlash {
  0%   { background: rgba(15,170,106,.22); }
  100% { background: transparent; }
}
.live-flash { animation: liveRowFlash 1.4s ease-out; }

/* ── Toggle Button ── */
.toggle-btn {
  border: none;
  background: none;
  padding: 7px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  font-family: 'KakaoSmall', sans-serif;
  color: var(--text2);
  cursor: pointer;
  transition: background .15s, color .15s;
  letter-spacing: -.1px;
}
.toggle-btn.active {
  background: var(--surface);
  color: var(--accent);
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(15,22,45,.1);
}

.academy-badge-fixed {
  position: fixed;
  bottom: 18px;
  right: 22px;
  z-index: -1;
  text-align: right;
  pointer-events: none;
  user-select: none;
  line-height: 1.3;
}
.academy-badge-fixed .ab-name {
  font-size: 17px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: .06em;
}
.academy-badge-fixed .ab-sub {
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  letter-spacing: .14em;
}

/* ── Liquid Glass: Toggle Group Container ── */
body.has-academy-bg [id$="ToggleWrap"],
body.has-academy-bg [id$="toggleWrap"] {
  background:
    linear-gradient(
      155deg,
      rgba(255,255,255,.38) 0%,
      rgba(255,255,255,.18) 100%
    ) !important;
  border-color: rgba(255,255,255,.42) !important;
  backdrop-filter: blur(32px) saturate(1.6) brightness(1.02);
  -webkit-backdrop-filter: blur(32px) saturate(1.6) brightness(1.02);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.5),
    0 4px 12px rgba(30, 42, 100, .1) !important;
}

/* ── Liquid Glass: Metric card icon tint ── */
body.has-academy-bg .metric-card .metric-icon {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5);
}

/* ── Liquid Glass: nav-divider ── */
body.has-academy-bg .nav-divider {
  background: rgba(255,255,255,.25);
}

/* ── Liquid Glass: card inner border improvement ── */
body.has-academy-bg .card,
body.has-academy-bg .metric-card,
body.has-academy-bg .modal-box {
  border-radius: var(--radius-lg);
}

/* ── Liquid Glass: scrollbar in glass mode ── */
body.has-academy-bg ::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.35);
}

/* ── Liquid Glass: table row hover ── */
body.has-academy-bg table.tbl tbody tr:hover td {
  background: rgba(255,255,255,.22);
}
