/* 전주대 한국어교육센터 학사관리 시스템 — 공통 스타일
   레이아웃 골격과 tailwind 로 표현하기 번거로운 것만 여기에 둔다. */

:root {
  --kc-primary: #065f46;        /* emerald-800 */
  --kc-primary-dark: #064e3b;
  --kc-sidebar-w: 232px;
  --kc-sidebar-w-collapsed: 56px;
  --kc-header-h: 52px;
  --kc-tabbar-h: 40px;
}

html, body { height: 100%; }
body { margin: 0; font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', -apple-system, sans-serif; }

/* ── 레이아웃 ─────────────────────────────── */
.kc-shell { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.kc-body  { flex: 1; display: flex; min-height: 0; }

.kc-sidebar {
  width: var(--kc-sidebar-w);
  flex-shrink: 0;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width .18s ease;
  background: var(--kc-primary-dark);
}
.kc-sidebar.collapsed { width: var(--kc-sidebar-w-collapsed); }
.kc-sidebar::-webkit-scrollbar { width: 6px; }
.kc-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 3px; }

.kc-main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.kc-content { flex: 1; overflow: auto; padding: 16px; }

/* ── 탭바 ─────────────────────────────────── */
.kc-tabbar {
  height: var(--kc-tabbar-h);
  display: flex;
  align-items: stretch;
  background: #e2e8f0;
  border-bottom: 1px solid #cbd5e1;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}
.kc-tabbar::-webkit-scrollbar { height: 4px; }
.kc-tabbar::-webkit-scrollbar-thumb { background: #94a3b8; }

.kc-tab {
  display: flex; align-items: center; gap: 6px;
  padding: 0 10px 0 12px;
  font-size: 12.5px;
  white-space: nowrap;
  border-right: 1px solid #cbd5e1;
  background: #f1f5f9;
  color: #475569;
  cursor: pointer;
  user-select: none;
  max-width: 220px;
}
.kc-tab:hover { background: #e2e8f0; }
.kc-tab.active {
  background: #ffffff;
  color: var(--kc-primary);
  font-weight: 700;
  box-shadow: inset 0 2px 0 var(--kc-primary);
}
.kc-tab .kc-tab-title { overflow: hidden; text-overflow: ellipsis; }
.kc-tab .kc-tab-close {
  width: 16px; height: 16px; line-height: 15px; text-align: center;
  border-radius: 3px; font-size: 13px; color: #94a3b8; flex-shrink: 0;
}
.kc-tab .kc-tab-close:hover { background: #cbd5e1; color: #dc2626; }
.kc-tab.dragging { opacity: .45; }
.kc-tab.drop-target { box-shadow: inset 3px 0 0 var(--kc-primary); }

/* ── 표 ──────────────────────────────────── */
.kc-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.kc-table thead th {
  position: sticky; top: 0; z-index: 1;
  background: #f1f5f9;
  color: #334155;
  font-weight: 700;
  text-align: left;
  padding: 7px 10px;
  border-bottom: 1px solid #cbd5e1;
  white-space: nowrap;
}
.kc-table tbody td { padding: 6px 10px; border-bottom: 1px solid #e2e8f0; }
.kc-table tbody tr:hover { background: #f8fafc; }
.kc-table tbody tr.selected { background: #ecfdf5; }
.kc-table-wrap { overflow: auto; border: 1px solid #e2e8f0; border-radius: 6px; background: #fff; }

/* ── 폼 ──────────────────────────────────── */
.kc-input, .kc-select, .kc-textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 5px 8px;
  font-size: 12.5px;
  background: #fff;
  color: #1e293b;
}
.kc-input:focus, .kc-select:focus, .kc-textarea:focus {
  outline: none;
  border-color: var(--kc-primary);
  box-shadow: 0 0 0 2px rgba(6,95,70,.15);
}
.kc-input:disabled, .kc-select:disabled { background: #f1f5f9; color: #94a3b8; }
.kc-label { display: block; font-size: 11.5px; font-weight: 700; color: #475569; margin-bottom: 3px; }

.kc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 5px 12px; border-radius: 4px; font-size: 12.5px; font-weight: 700;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: background .12s ease;
}
.kc-btn:disabled { opacity: .45; cursor: not-allowed; }
.kc-btn-primary { background: var(--kc-primary); color: #fff; }
.kc-btn-primary:not(:disabled):hover { background: var(--kc-primary-dark); }
.kc-btn-default { background: #fff; color: #334155; border-color: #cbd5e1; }
.kc-btn-default:not(:disabled):hover { background: #f1f5f9; }
.kc-btn-danger { background: #dc2626; color: #fff; }
.kc-btn-danger:not(:disabled):hover { background: #b91c1c; }
.kc-btn-sm { padding: 3px 8px; font-size: 11.5px; }

/* ── 카드/패널 ────────────────────────────── */
.kc-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 6px; }
.kc-card-head {
  padding: 8px 12px; border-bottom: 1px solid #e2e8f0;
  font-size: 13px; font-weight: 700; color: #334155;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.kc-card-body { padding: 12px; }

/* ── 상태 배지 ────────────────────────────── */
.kc-badge {
  display: inline-block; padding: 1px 7px; border-radius: 9999px;
  font-size: 11px; font-weight: 700; line-height: 17px;
}

/* 출결 색상 (기존 시스템과 동일하게 유지) */
.att-PRESENT  { color: #059669; }
.att-TARDY    { color: #d97706; }
.att-ABSENT   { color: #dc2626; }
.att-OFFICIAL { color: #2563eb; }

/* 인쇄 시 사이드바/탭바 제외 */
@media print {
  .kc-sidebar, .kc-tabbar, .kc-topbar, .no-print { display: none !important; }
  .kc-content { overflow: visible; padding: 0; }
}
