:root {
  --navy: #0f172a; --blue: #1e40af; --blue2: #2563eb;
  --bg: #f1f5f9; --card: #ffffff; --line: #e2e8f0; --txt: #0f172a; --mut: #64748b;
  --auto: #2563eb; --robotics: #7c3aed; --memory: #0891b2; --byd: #ea580c;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { margin: 0; font-family: 'Malgun Gothic', '맑은 고딕', system-ui, sans-serif; background: var(--bg); color: var(--txt); }
.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--navy), var(--blue)); padding: 16px; }
.login-card { background: #fff; border-radius: 16px; padding: 28px 22px; width: 100%; max-width: 360px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-card .brand { font-size: 20px; font-weight: 800; color: var(--blue); }
.login-card .sub { color: var(--mut); margin: 4px 0 20px; font-size: 13px; }
.login-card input { width: 100%; padding: 12px 14px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 15px; }
.login-card button { width: 100%; padding: 13px; border: 0; border-radius: 10px; background: var(--blue); color: #fff; font-size: 15px; font-weight: 700; cursor: pointer; }
.login-card button:disabled { opacity: .6; }
.login-card .err { color: #dc2626; font-size: 13px; min-height: 18px; margin-top: 6px; }
.login-card .hint { color: var(--mut); font-size: 12px; text-align: center; margin-top: 14px; }

.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: linear-gradient(135deg, var(--navy), var(--blue)); color: #fff; }
.topbar-title { font-weight: 800; font-size: 16px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.who { font-size: 13px; opacity: .9; }
.link-btn { background: rgba(255,255,255,.15); color: #fff; border: 0; border-radius: 8px; padding: 6px 10px; font-size: 13px; cursor: pointer; }

.container { max-width: 720px; margin: 0 auto; padding: 14px 14px 40px; }
.filters { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px; position: sticky; top: 56px; background: var(--bg); z-index: 5; }
.chip { flex: 0 0 auto; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 14px; font-size: 13px; cursor: pointer; }
.chip.on { background: var(--blue); color: #fff; border-color: var(--blue); }

.day { margin-bottom: 18px; }
.day h3 { font-size: 14px; color: var(--mut); margin: 6px 2px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.card { display: flex; flex-direction: column; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; text-align: left; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.card:active { transform: scale(.98); }
.card-sector { font-weight: 800; font-size: 15px; }
.card-sector.s-auto { color: var(--auto); }
.card-sector.s-robotics { color: var(--robotics); }
.card-sector.s-memory { color: var(--memory); }
.card-sector.s-byd { color: var(--byd); }
.card-period { font-size: 13px; color: var(--mut); }
.card-time { font-size: 12px; color: #94a3b8; }
.loading, .empty { color: var(--mut); text-align: center; padding: 40px; }

.viewer { position: fixed; inset: 0; background: #fff; z-index: 50; display: flex; flex-direction: column; }
.viewer-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: var(--navy); color: #fff; font-size: 14px; }
.viewer iframe { flex: 1; border: 0; width: 100%; }

.admin { position: fixed; inset: 0; background: var(--bg); z-index: 60; display: flex; flex-direction: column; }
.admin-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--navy); color: #fff; font-weight: 700; }
.admin-tabs { display: flex; gap: 8px; padding: 10px 16px 0; }
.tab { border: 0; background: #fff; border: 1px solid var(--line); border-radius: 8px 8px 0 0; padding: 8px 14px; cursor: pointer; }
.tab.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.admin-tab { flex: 1; overflow: auto; padding: 14px 16px; }
.adduser { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.adduser input, .adduser select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.mini { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 10px; font-size: 12px; cursor: pointer; }
.grid { width: 100%; border-collapse: collapse; background: #fff; font-size: 13px; }
.grid th, .grid td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.grid th { background: #f8fafc; }
.grid small { color: var(--mut); }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: #0f172a; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13px; z-index: 100; box-shadow: 0 10px 30px rgba(0,0,0,.3); }
.hidden { display: none !important; }

/* 비밀번호 변경 모달 */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-box { background: #fff; border-radius: 14px; width: 100%; max-width: 360px; box-shadow: 0 20px 60px rgba(0,0,0,.25); overflow: hidden; }
.modal-head { background: var(--blue); color: #fff; padding: 14px 16px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.modal-head .link-btn { color: #fff; font-size: 16px; }
.modal-body { padding: 18px 16px; }
.modal-body label { display: block; font-size: 12px; font-weight: 600; color: var(--mut); margin: 12px 0 4px; }
.modal-body small { font-weight: 400; color: var(--mut); }
.modal-body input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
.modal-body input:focus { outline: none; border-color: var(--blue2); }
.modal-msg { font-size: 12px; color: #dc2626; min-height: 16px; margin: 8px 0 4px; }
.btn-primary { display: block; width: 100%; background: var(--blue2); color: #fff; border: none; border-radius: 8px; padding: 11px; font-size: 14px; font-weight: 600; cursor: pointer; margin-top: 14px; }
.btn-primary:hover { background: var(--blue); }
.link-btn { background: none; border: none; cursor: pointer; font-size: 13px; color: var(--blue2); font-family: inherit; padding: 4px 6px; border-radius: 6px; }
.link-btn:hover { background: #eff6ff; }

/* 학습 카드 (리포트 목록에 통합) */
.card-sector.s-learning { color: #7c3aed; background: linear-gradient(135deg, #667eea, #764ba2); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; font-weight: 900; }
.learn-items { font-size: 11px; color: #94a3b8; margin-top: 2px; }
