:root {
  --navy: #0f1e3d;
  --navy-light: #1a2f5c;
  --royal: #1d4ed8;
  --gold: #c9a227;
}
* { -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body { min-height: 100vh; overflow-x: hidden; }
button, input, select, textarea { font: inherit; }

.gradient-navy { background: linear-gradient(135deg, #0f1e3d 0%, #1a2f5c 60%, #1d4ed8 100%); }
.gradient-gold { background: linear-gradient(135deg, #c9a227 0%, #e0be4d 100%); }
.text-gold { color: #c9a227; }
.bg-navy { background-color: #0f1e3d; }
.bg-navy-light { background-color: #1a2f5c; }
.border-gold { border-color: #c9a227; }

.card { background: #fff; border-radius: 16px; box-shadow: 0 2px 12px rgba(15,30,61,.08); }
.card-hover { transition: transform .2s, box-shadow .2s; }
.card-hover:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(15,30,61,.16); }

.btn { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 8px; font-weight: 700; border-radius: 12px; padding: 10px 18px; transition: all .15s; cursor: pointer; border: none; }
.btn-primary { background: #1d4ed8; color: #fff; }
.btn-primary:hover { background: #1e40af; }
.btn-navy { background: #0f1e3d; color: #fff; }
.btn-navy:hover { background: #1a2f5c; }
.btn-gold { background: #c9a227; color: #0f1e3d; }
.btn-gold:hover { background: #b8911f; }
.btn-outline { background: #fff; border: 1.5px solid #d1d5db; color: #374151; }
.btn-outline:hover { border-color: #1d4ed8; color: #1d4ed8; }
.btn-danger { background: #dc2626; color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-green { background: #dcfce7; color: #166534; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-yellow { background: #fef9c3; color: #854d0e; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-gray { background: #f1f5f9; color: #475569; }

.input { width: 100%; min-height: 48px; padding: 11px 14px; border: 1.5px solid #dbe3ef; border-radius: 12px; font-size: 16px; transition: border .15s; background:#fff; }
.input:focus { outline: none; border-color: #1d4ed8; box-shadow: 0 0 0 3px rgba(29,78,216,.1); }
label.field { display:block; font-size: 13px; font-weight: 600; color: #475569; margin-bottom: 6px; }

.table { width: 100%; border-collapse: collapse; }
.table th { background: #f8fafc; padding: 12px; text-align: left; font-size: 13px; font-weight: 700; color: #475569; border-bottom: 2px solid #e2e8f0; white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid #f1f5f9; font-size: 14px; }
.table tr:hover td { background: #f8fafc; }

.toast { max-width: calc(100vw - 24px); padding: 12px 18px; border-radius: 12px; color: #fff; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.2); animation: slideIn .3s; }
.toast-success { background: #16a34a; }
.toast-error { background: #dc2626; }
.toast-info { background: #1d4ed8; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.sidebar-link { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-radius: 10px; color: #cbd5e1; font-size: 14px; font-weight: 500; cursor: pointer; transition: all .15s; }
.sidebar-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-link.active { background: #1d4ed8; color: #fff; }

.modal-overlay { position: fixed; inset: 0; background: rgba(15,30,61,.62); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 16px; }
.modal-box { background: #fff; border-radius: 20px; max-width: 640px; width: 100%; max-height: 90vh; overflow-y: auto; }

.student-hero { background: radial-gradient(circle at 90% 10%, #2856c8 0, transparent 35%), linear-gradient(145deg, #0f1e3d 0%, #173b86 100%); }
.quick-steps { display: inline-flex; align-items: center; gap: 10px; padding: 9px 14px; border: 1px solid rgba(255,255,255,.16); border-radius: 999px; background: rgba(255,255,255,.08); font-size: 13px; color: #e2e8f0; }
.quick-steps b { display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; margin-right: 3px; border-radius: 50%; background: #c9a227; color: #0f1e3d; }
.quick-steps i { color: rgba(255,255,255,.45); font-size: 10px; }
.category-scroller { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; overscroll-behavior-x: contain; }
.category-scroller::-webkit-scrollbar { display: none; }
.category-scroller .btn { flex: 0 0 auto; min-height: 40px; padding: 8px 14px; white-space: nowrap; }
.course-media { height: 132px; }
.admin-gear { width: 42px; height: 42px; flex: 0 0 42px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,.3); border-radius: 12px; background: rgba(255,255,255,.1); color: #fff; }
.admin-gear:hover { background: rgba(255,255,255,.2); }
.mobile-safe-bottom { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
.mobile-action-bar { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }

/* 자격증 인쇄 스타일 */
@media print {
  body * { visibility: hidden; }
  #cert-print-area, #cert-print-area * { visibility: visible; }
  #cert-print-area { position: absolute; left: 0; top: 0; width: 100%; }
  .no-print { display: none !important; }
}

.exam-choice { border: 2px solid #e2e8f0; border-radius: 12px; padding: 16px; cursor: pointer; transition: all .15s; font-size: 16px; }
.exam-choice:hover { border-color: #93c5fd; background: #f8fafc; }
.exam-choice.selected { border-color: #1d4ed8; background: #eff6ff; }

.spinner { border: 3px solid #e2e8f0; border-top-color: #1d4ed8; border-radius: 50%; width: 32px; height: 32px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 639px) {
  .brand-name { max-width: 116px; }
  .card { border-radius: 14px; }
  .card-hover:hover { transform: none; box-shadow: 0 2px 12px rgba(15,30,61,.08); }
  .landing-hero { min-height: 310px; display: flex; align-items: center; }
  .quick-steps { width: 100%; justify-content: center; gap: 7px; font-size: 12px; }
  .course-card { display: grid; grid-template-columns: 118px minmax(0,1fr); min-height: 132px; }
  .course-media { height: 100%; min-height: 132px; }
  .course-content { display: flex; flex-direction: column; justify-content: center; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-box { max-width: none !important; border-radius: 22px 22px 0 0; max-height: 92vh; padding-bottom: env(safe-area-inset-bottom); }
  .exam-choice { min-height: 58px; padding: 14px; display: flex; align-items: center; }
  #toast-root { top: 72px; left: 12px; right: 12px; }
  #toast-root .toast { width: 100%; }
}

@media (max-width: 370px) {
  .brand-name { max-width: 88px; font-size: 12px; }
  .admin-gear { width: 38px; height: 38px; flex-basis: 38px; }
}
