/* ============================================================
   학교 회의관리 시스템 — Design System v3
   ─────────────────────────────────────────────────────────
   Steel Blue  #5DA4D7  primary accent
   Off-White   #F9FBFB  background
   Sage Green  #8CAD9E  success / secondary accent
   Dark Slate  #2C3E50  primary text
   Mid Slate   #5D6D7E  secondary text
   ============================================================ */

:root {
  /* Brand */
  --blue:         #5DA4D7;
  --blue-dark:    #4A8EC0;
  --blue-deeper:  #3876AB;
  --blue-light:   #EBF4FB;
  --blue-mid:     #CEE7F5;

  --sage:         #8CAD9E;
  --sage-dark:    #6E9282;
  --sage-deeper:  #4E7264;
  --sage-light:   #E8F3EE;
  --sage-mid:     #C8DFD5;

  --offwhite:     #F9FBFB;
  --offwhite-dim: #F1F5F6;

  /* Text */
  --text-primary:   #2C3E50;
  --text-secondary: #5D6D7E;
  --text-muted:     #93A3B1;
  --text-invert:    #FFFFFF;

  /* State */
  --danger:  #C0392B;
  --warning: #C97F0A;

  /* Border */
  --border:       #D5E1E8;
  --border-light: #EBF0F4;

  /* Shadow — 딱 두 단계만 */
  --shadow-card: 0 1px 3px rgba(44,62,80,0.07), 0 4px 12px rgba(44,62,80,0.05);
  --shadow-modal: 0 8px 32px rgba(44,62,80,0.16), 0 2px 8px rgba(44,62,80,0.08);

  /* Legacy aliases */
  --bg:             var(--offwhite);
  --surface:        #FFFFFF;
  --surface-low:    var(--offwhite-dim);
  --surface-mid:    var(--blue-mid);
  --surface-high:   #C0DCF0;
  --surface-dim:    #C0DCF0;
  --primary:        var(--blue-deeper);
  --primary-soft:   var(--blue-dark);
  --secondary:      var(--blue);
  --secondary-btn:  var(--blue);
  --accent:         var(--sage);
  --on-surface:     var(--text-primary);
  --on-muted:       var(--text-secondary);
  --border-light:   var(--border-light);
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', 'Noto Sans KR', -apple-system, sans-serif;
  background: var(--offwhite);
  color: var(--text-primary);
  margin: 0; padding: 0;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   로그인
   ============================================================ */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  /* 단색 배경 + 미묘한 패턴 */
  background-color: #3B7DB8;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(140,173,158,0.25) 0%, transparent 50%),
    radial-gradient(circle at 80% 15%, rgba(255,255,255,0.10) 0%, transparent 45%);
  padding: 24px;
}

.login-card {
  background: #FFFFFF;
  border-radius: 16px;
  padding: 48px 44px;
  width: 100%;
  max-width: 400px;
  box-shadow:
    0 0 0 1px rgba(44,62,80,0.06),
    0 20px 60px rgba(44,62,80,0.18);
}

/* ============================================================
   앱 레이아웃
   ============================================================ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ─── 사이드바 ─── */
.sidebar {
  width: 236px;
  /* 짙은 단색 — 그라디언트 없이 깊이는 subtle overlay로 */
  background: #2D5F8A;
  color: white;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 30;
  /* 오른쪽에 자연스러운 그림자만 */
  box-shadow: 1px 0 0 rgba(255,255,255,0.04), 4px 0 24px rgba(0,0,0,0.12);
}

.sidebar-header {
  padding: 20px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.sidebar-logo-icon {
  width: 32px; height: 32px;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.20);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,0.95);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.sidebar-user {
  font-size: 11.5px;
  color: rgba(255,255,255,0.52);
  line-height: 1.7;
}

.sidebar-user strong {
  color: rgba(255,255,255,0.88);
  font-weight: 600;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 8px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.32);
  padding: 12px 12px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border-radius: 7px;
  cursor: pointer;
  color: rgba(255,255,255,0.62);
  transition: background 0.12s, color 0.12s;
  margin-bottom: 1px;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-size: 13.5px;
  font-family: inherit;
}

.nav-item:hover {
  background: rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.92);
}

.nav-item.active {
  background: rgba(255,255,255,0.16);
  color: #FFFFFF;
  font-weight: 600;
  position: relative;
}

/* 활성 인디케이터 — 얇은 흰 바 */
.nav-item.active::after {
  content: '';
  position: absolute;
  right: 0; top: 25%; height: 50%;
  width: 3px;
  background: rgba(255,255,255,0.70);
  border-radius: 2px 0 0 2px;
}

.nav-item i {
  font-size: 13px;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.80;
}
.nav-item.active i { opacity: 1; }

.sidebar-footer {
  padding: 8px 8px 14px;
  border-top: 1px solid rgba(255,255,255,0.07);
}

/* ─── 메인 ─── */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-left: 236px;
}

/* ─── 탑바 ─── */
.topbar {
  background: #FFFFFF;
  border-bottom: 1px solid var(--border-light);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 20;
  height: 52px;
}

.topbar-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

/* ─── 콘텐츠 영역 ─── */
.content-area {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  background: var(--offwhite);
}

/* ============================================================
   카드
   ============================================================ */
.card {
  background: #FFFFFF;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  padding: 22px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-light);
  background: var(--offwhite-dim);
  border-radius: 10px 10px 0 0;
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ── 페이지 섹션 헤더 ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: '';
  display: inline-block;
  width: 3.5px;
  height: 18px;
  background: var(--blue);
  border-radius: 2px;
  flex-shrink: 0;
}

/* ============================================================
   회의 유형 탭
   ============================================================ */
.type-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.type-tab {
  padding: 5px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 500;
  transition: all 0.12s;
  background: #FFFFFF;
  color: var(--text-secondary);
}

.type-tab:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-light);
}

.type-tab.active {
  color: white;
  border-color: transparent;
  font-weight: 600;
}

/* ============================================================
   회의 카드
   ============================================================ */
.meeting-card {
  background: #FFFFFF;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  padding: 14px 18px;
  margin-bottom: 7px;
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: var(--shadow-card);
}

.meeting-card:hover {
  border-color: var(--blue-mid);
  box-shadow: 0 2px 12px rgba(93,164,215,0.12), 0 1px 3px rgba(44,62,80,0.06);
}

.meeting-card-accent {
  width: 3px;
  min-height: 40px;
  border-radius: 2px;
  flex-shrink: 0;
  align-self: stretch;
}

.meeting-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  color: white;
  letter-spacing: 0.02em;
}

/* ============================================================
   상태 배지
   ============================================================ */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.status-scheduled      { background: var(--blue-light);  color: var(--blue-deeper); }
.status-ongoing        { background: var(--sage-light);   color: var(--sage-deeper); }
.status-signing_closed { background: #FEF0CD;            color: #8A5E00; }
.status-completed      { background: var(--offwhite-dim); color: var(--text-secondary); border: 1px solid var(--border); }
.status-cancelled      { background: #FDECEA;            color: var(--danger); }

.attendance-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

.badge-signed  { background: var(--sage-light);  color: var(--sage-deeper); }
.badge-absent  { background: #FDECEA;            color: var(--danger); }
.badge-pending { background: #FEF0CD;            color: #8A5E00; }

/* ============================================================
   폼
   ============================================================ */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 5px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-size: 14px;
  color: var(--text-primary);
  transition: border-color 0.12s, box-shadow 0.12s;
  background: #FFFFFF;
  font-family: inherit;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(93,164,215,0.14);
}

.form-input::placeholder { color: var(--text-muted); }
.form-textarea { resize: vertical; min-height: 80px; }

/* ============================================================
   버튼
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
  border: 1.5px solid transparent;
  font-family: inherit;
  white-space: nowrap;
}

.btn-primary {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}
.btn-primary:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  box-shadow: 0 3px 10px rgba(93,164,215,0.30);
}

.btn-secondary {
  background: #FFFFFF;
  color: var(--text-primary);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: var(--offwhite-dim);
  border-color: var(--blue-mid);
  color: var(--blue-dark);
}

.btn-success {
  background: var(--sage);
  color: white;
  border-color: var(--sage);
}
.btn-success:hover {
  background: var(--sage-dark);
  border-color: var(--sage-dark);
  box-shadow: 0 3px 10px rgba(140,173,158,0.30);
}

.btn-danger {
  background: #E74C3C;
  color: white;
  border-color: #E74C3C;
}
.btn-danger:hover { background: var(--danger); border-color: var(--danger); }

.btn-warning {
  background: #E09800;
  color: white;
  border-color: #E09800;
}
.btn-warning:hover { background: var(--warning); border-color: var(--warning); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
  padding: 6px 10px;
}
.btn-ghost:hover {
  background: var(--blue-light);
  color: var(--blue-dark);
}

.btn-sm  { padding: 5px 12px; font-size: 12px; border-radius: 5px; }
.btn-lg  { padding: 11px 28px; font-size: 15px; }
.btn:disabled { opacity: 0.40; cursor: not-allowed; box-shadow: none !important; }

/* ============================================================
   모달
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20,36,52,0.46);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  backdrop-filter: blur(2px);
}

.modal {
  background: #FFFFFF;
  border-radius: 12px;
  padding: 28px 30px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-modal);
  border: 1px solid var(--border-light);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
}

.modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

/* ============================================================
   데이터 테이블
   ============================================================ */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  background: var(--offwhite-dim);
  padding: 9px 16px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.data-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13.5px;
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tr:hover td { background: var(--blue-light); }
.data-table tr:last-child td { border-bottom: none; }

.table-wrap {
  background: #FFFFFF;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

/* ============================================================
   서명 캔버스
   ============================================================ */
.signature-canvas-wrap {
  border: 1.5px dashed var(--border);
  border-radius: 8px;
  background: var(--offwhite);
  position: relative;
  overflow: hidden;
  cursor: crosshair;
  transition: border-color 0.12s;
}

.signature-canvas-wrap:hover { border-color: var(--blue); }

.signature-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 200px;
  touch-action: none;
}

/* ============================================================
   키오스크 (공용기기 서명)
   ============================================================ */
.kiosk-container {
  min-height: 100vh;
  background-color: #3B7DB8;
  background-image:
    radial-gradient(circle at 15% 85%, rgba(140,173,158,0.22) 0%, transparent 50%),
    radial-gradient(circle at 85% 12%, rgba(255,255,255,0.08) 0%, transparent 45%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.kiosk-card {
  background: white;
  border-radius: 14px;
  padding: 36px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.22);
}

/* ── 참석자 선택 그리드 ── */
.participant-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 2px;
}

.participant-btn {
  padding: 13px;
  border: 1.5px solid var(--border-light);
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  transition: all 0.12s;
  background: white;
}

.participant-btn:hover:not(.signed) {
  border-color: var(--blue);
  background: var(--blue-light);
}

.participant-btn.signed {
  border-color: var(--sage);
  background: var(--sage-light);
  cursor: default;
}

.participant-btn .name        { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.participant-btn .dept         { font-size: 11px; color: var(--text-secondary); margin-top: 3px; }
.participant-btn .signed-mark  { font-size: 11px; color: var(--sage-darker, #4E7264); margin-top: 5px; font-weight: 600; }

/* ============================================================
   통계 카드 (선택 사용)
   ============================================================ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: #FFFFFF;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
  border-top: 3px solid var(--blue);
}

.stat-card.stat-sage   { border-top-color: var(--sage); }
.stat-card.stat-warn   { border-top-color: #E09800; }
.stat-card.stat-danger { border-top-color: var(--danger); }

.stat-card .stat-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.stat-card .stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  font-family: 'JetBrains Mono', monospace;
}

.stat-card .stat-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ============================================================
   토스트
   ============================================================ */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 11px 16px;
  border-radius: 8px;
  color: white;
  font-size: 13px;
  font-weight: 600;
  z-index: 9999;
  box-shadow: 0 4px 20px rgba(0,0,0,0.16);
  animation: slideIn 0.2s ease;
  max-width: 300px;
}

.toast-success { background: var(--sage-dark); }
.toast-error   { background: #C0392B; }
.toast-info    { background: var(--blue-dark); }

@keyframes slideIn {
  from { transform: translateX(110%); opacity: 0; }
  to   { transform: translateX(0);   opacity: 1; }
}

/* ============================================================
   스피너
   ============================================================ */
.spinner {
  border: 2.5px solid var(--blue-mid);
  border-top: 2.5px solid var(--blue);
  border-radius: 50%;
  width: 28px; height: 28px;
  animation: spin 0.6s linear infinite;
  margin: 40px auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* 빈 상태 */
.empty-state {
  text-align: center;
  padding: 56px 20px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 32px;
  margin-bottom: 12px;
  display: block;
  opacity: 0.35;
}

.empty-state p {
  font-size: 13.5px;
  color: var(--text-muted);
  margin: 0;
}

/* ============================================================
   드래그앤드롭
   ============================================================ */
.drag-list { list-style: none; margin: 0; padding: 0; }

.drag-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: 7px;
  margin-bottom: 4px;
  cursor: grab;
  transition: box-shadow 0.12s, background 0.12s, border-color 0.12s;
  user-select: none;
  font-size: 13px;
  box-shadow: var(--shadow-card);
}

.drag-item:active { cursor: grabbing; }

.drag-item.drag-over {
  background: var(--blue-light);
  border-color: var(--blue-mid);
  box-shadow: 0 2px 10px rgba(93,164,215,0.14);
}

.drag-item.dragging { opacity: 0.35; }

.drag-handle {
  color: var(--border);
  font-size: 14px;
  cursor: grab;
  flex-shrink: 0;
}

.drag-dept-header {
  background: var(--offwhite-dim);
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue-mid);
  border-radius: 7px;
  padding: 6px 12px;
  margin: 8px 0 2px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--blue-deeper);
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ============================================================
   칩 / 태그
   ============================================================ */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 600;
}

.chip-blue  { background: var(--blue-light);   color: var(--blue-deeper);  border: 1px solid var(--blue-mid); }
.chip-sage  { background: var(--sage-light);   color: var(--sage-deeper);  border: 1px solid var(--sage-mid); }
.chip-gray  { background: var(--offwhite-dim); color: var(--text-secondary); border: 1px solid var(--border); }

/* ============================================================
   구분선 / 인포박스
   ============================================================ */
.divider { height: 1px; background: var(--border-light); margin: 16px 0; }

.info-box {
  background: var(--blue-light);
  border: 1px solid var(--blue-mid);
  border-left: 3px solid var(--blue);
  border-radius: 7px;
  padding: 11px 14px;
  font-size: 13px;
  color: var(--blue-deeper);
}

.info-box.sage {
  background: var(--sage-light);
  border-color: var(--sage-mid);
  border-left-color: var(--sage);
  color: var(--sage-deeper);
}

/* ============================================================
   스크롤바
   ============================================================ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--blue-mid); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--blue); }

/* ============================================================
   인쇄 기본
   ============================================================ */
@media print {
  body { background: white; }
  .no-print { display: none !important; }
}

/* ============================================================
   반응형
   ============================================================ */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; }
  .participant-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
