/* ── Variables ─────────────────────────────────────────────────────── */
:root {
  --primary:       #2E7D32;
  --primary-light: #43A047;
  --primary-dark:  #1B5E20;
  --accent:        #C8A96B;
  --accent-light:  #E8C987;
  --bg:            #F8F6EF;
  --bg-card:       #FFFFFF;
  --text-dark:     #1A1A1A;
  --text-mid:      #555555;
  --text-light:    #888888;
  --border:        #E5E2D8;
  --shadow:        0 2px 12px rgba(0,0,0,0.07);
  --shadow-md:     0 4px 20px rgba(0,0,0,0.11);
  --radius:        16px;
  --radius-sm:     8px;
  --sidebar-w:     240px;
  --topbar-h:      60px;
  --win:  #2E7D32;
  --lose: #C62828;
  --draw: #F57F17;
}

/* ── Reset ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Nanum Gothic', 'Apple SD Gothic Neo', sans-serif;
  background: var(--bg);
  color: var(--text-dark);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  word-break: keep-all;
  line-height: 1.6;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
/* 모든 폼 요소에 동일 폰트 적용 */
input, textarea, select, button {
  font-family: 'Nanum Gothic', 'Apple SD Gothic Neo', sans-serif;
}
img { max-width: 100%; }
textarea { resize: vertical; }

/* ── Layout ─────────────────────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--primary-dark);
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transition: transform 0.3s ease;
}
.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; gap: 12px;
}
.sidebar-logo-icon {
  width: 40px; height: 40px;
  background: var(--accent);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.sidebar-logo-text { color: #fff; }
.sidebar-logo-text strong { display: block; font-size: 14px; font-weight: 800; letter-spacing: -0.3px; }
.sidebar-logo-text span { font-size: 11px; color: rgba(255,255,255,0.6); }

.sidebar-nav { padding: 12px 0; flex: 1; }
.sidebar-section-label {
  padding: 16px 20px 6px;
  font-size: 10px; font-weight: 700;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 20px;
  color: rgba(255,255,255,0.7);
  font-size: 14px; font-weight: 600;
  transition: background 0.15s, color 0.15s;
  border-left: 3px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active { background: rgba(255,255,255,0.1); color: #fff; border-left-color: var(--accent); }
.nav-item.soon { opacity: 0.45; }
.nav-item.soon::after { content: 'Soon'; font-size: 9px; background: rgba(255,255,255,0.15); padding: 2px 6px; border-radius: 10px; margin-left: auto; }
.nav-icon { width: 20px; text-align: center; font-size: 16px; flex-shrink: 0; }
.nav-item-sub { padding-left: 36px; font-size: 13px; font-weight: 600; }
.nav-item-sub .nav-icon { font-size: 10px; color: var(--accent); }
.sidebar-divider { height: 1px; background: rgba(255,255,255,0.1); margin: 8px 20px; }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.1); }
.btn-logout {
  display: flex; align-items: center; gap: 8px;
  color: rgba(255,255,255,0.5); font-size: 13px;
  padding: 8px 0; background: none; border: none; width: 100%;
}
.btn-logout:hover { color: rgba(255,255,255,0.8); }

.main-wrapper { margin-left: var(--sidebar-w); flex: 1; min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 28px; gap: 16px;
  position: sticky; top: 0; z-index: 100;
}
.topbar-hamburger { display: none; background: none; border: none; font-size: 20px; color: var(--text-mid); padding: 4px; }
.topbar-title { font-size: 16px; font-weight: 700; color: var(--text-dark); }
.topbar-spacer { flex: 1; }
.topbar-user { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-mid); }
.topbar-avatar {
  width: 32px; height: 32px;
  background: var(--primary); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px; font-weight: 700;
}

.content { padding: 28px; flex: 1; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 150; }

/* ── Alerts ─────────────────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 20px; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.alert-success { background: #E8F5E9; color: #2E7D32; border-left: 4px solid #2E7D32; }
.alert-error   { background: #FFEBEE; color: #C62828; border-left: 4px solid #C62828; }
.alert-info    { background: #E3F2FD; color: #1565C0; border-left: 4px solid #1565C0; }

/* ── Page Header ─────────────────────────────────────────────────────── */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-header h1 { font-size: 22px; font-weight: 800; }
.page-header p { font-size: 13px; color: var(--text-light); margin-top: 2px; }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 20px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 700; border: none; transition: all 0.15s; cursor: pointer; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); }
.btn-accent  { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-light); }
.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-mid); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg); border-color: var(--text-mid); }
.btn-danger { background: #C62828; color: #fff; }
.btn-danger:hover { background: #B71C1C; }
.btn-sm { padding: 7px 14px; font-size: 13px; }

/* ── Cards ──────────────────────────────────────────────────────────── */
.card { background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); overflow: hidden; }
.card-header { padding: 18px 20px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-header h2 { font-size: 16px; font-weight: 700; }
.card-body { padding: 20px; }

/* ── Stat Cards ──────────────────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border);
  box-shadow: var(--shadow); padding: 20px; position: relative; overflow: hidden;
}
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--accent); }
.stat-label { font-size: 12px; color: var(--text-light); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 800; color: var(--text-dark); line-height: 1; }
.stat-sub { font-size: 12px; color: var(--text-light); margin-top: 4px; }

/* ── Quote Card ──────────────────────────────────────────────────────── */
.quote-card {
  background: var(--primary-dark); border-radius: var(--radius);
  padding: 24px 28px; margin-bottom: 24px; position: relative; overflow: hidden;
}
.quote-card::before {
  content: '"'; position: absolute; top: -10px; left: 16px;
  font-size: 80px; color: rgba(255,255,255,0.06);
  font-family: Georgia, serif; line-height: 1;
}
.quote-label { font-size: 11px; color: var(--accent); font-weight: 700; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 8px; }
.quote-text { font-size: 20px; font-weight: 800; color: #fff; line-height: 1.4; }

/* ── Grid layouts ────────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.dash-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 20px; }

/* ── Recent Lists ────────────────────────────────────────────────────── */
.recent-list { list-style: none; }
.recent-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.recent-item:last-child { border-bottom: none; }
.recent-item-icon { width: 36px; height: 36px; background: var(--bg); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 16px; }
.recent-item-content { flex: 1; min-width: 0; }
.recent-item-title { font-size: 14px; font-weight: 600; color: var(--text-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-item-meta { font-size: 12px; color: var(--text-light); margin-top: 2px; }

/* ── Badge / Tag ─────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge-primary  { background: #E8F5E9; color: var(--primary); }
.badge-accent   { background: #FFF8E1; color: #B8860B; }
.badge-gray     { background: #F5F5F5; color: var(--text-mid); }
.badge-attack   { background: #FFEBEE; color: #C62828; }
.badge-defense  { background: #E3F2FD; color: #1565C0; }
.badge-system   { background: #F3E5F5; color: #6A1B9A; }
.badge-position { background: #E8F5E9; color: #2E7D32; }
.badge-battle   { background: #FFF3E0; color: #E65100; }
.badge-stroke   { background: #E8F5E9; color: #2E7D32; }
.badge-thickness{ background: #E3F2FD; color: #1565C0; }
.badge-spin     { background: #F3E5F5; color: #6A1B9A; }
.badge-mental   { background: #FFF8E1; color: #B8860B; }
.badge-game     { background: #FFEBEE; color: #C62828; }
.tag { display: inline-flex; align-items: center; padding: 4px 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 20px; font-size: 12px; color: var(--text-mid); font-weight: 600; }
.tags-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.stars { color: var(--accent); font-size: 14px; letter-spacing: 1px; }

/* ── Result badges ─────────────────────────────────────────────────── */
.result-win  { background: #E8F5E9; color: var(--win);  padding: 4px 12px; border-radius: 20px; font-weight: 700; font-size: 13px; display: inline-block; }
.result-lose { background: #FFEBEE; color: var(--lose); padding: 4px 12px; border-radius: 20px; font-weight: 700; font-size: 13px; display: inline-block; }
.result-draw { background: #FFF8E1; color: var(--draw); padding: 4px 12px; border-radius: 20px; font-weight: 700; font-size: 13px; display: inline-block; }

/* ── Forms ──────────────────────────────────────────────────────────── */
.form-section { margin-bottom: 24px; }
.form-section-title { font-size: 13px; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 2px solid var(--primary); display: inline-block; }
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-mid);
  margin-bottom: 7px;
  letter-spacing: 0.3px;
  word-break: keep-all;
  line-height: 1.4;
}
.form-group label .req { color: #C62828; margin-left: 2px; }
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: 'Nanum Gothic', 'Apple SD Gothic Neo', sans-serif;
  background: var(--bg-card);
  color: var(--text-dark);
  transition: border-color 0.15s;
  outline: none;
  line-height: 1.6;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(46,125,50,0.08); }
.form-control::placeholder { color: var(--text-light); font-weight: 400; }
textarea.form-control { min-height: 100px; }
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px;
}
.form-grid { display: grid; gap: 16px; }
.form-grid-2 { grid-template-columns: 1fr 1fr; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-hint { font-size: 12px; color: var(--text-light); margin-top: 4px; }

/* Star rating input */
.star-rating-input { display: flex; flex-direction: row-reverse; gap: 4px; }
.star-radio { display: none; }
.star-label { font-size: 28px; color: #ddd; cursor: pointer; transition: color 0.1s; }
.star-rating-input .star-radio:checked ~ .star-label,
.star-rating-input .star-label:hover,
.star-rating-input .star-label:hover ~ .star-label { color: var(--accent); }

/* ── Table ──────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { font-size: 12px; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.5px; padding: 10px 14px; text-align: left; border-bottom: 2px solid var(--border); white-space: nowrap; }
td { font-size: 14px; padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg); }
.td-right { text-align: right; }
.td-center { text-align: center; }

/* ── Filter Bar ─────────────────────────────────────────────────────── */
.filter-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.filter-bar .form-control { width: auto; padding: 8px 12px; font-size: 13px; }
.search-input { flex: 1; min-width: 180px; max-width: 320px; }

/* ── Card Grid (배치 라이브러리) ──────────────────────────────────────── */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.billiard-card {
  background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border);
  box-shadow: var(--shadow); overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex; flex-direction: column;
}
.billiard-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.billiard-card-img {
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, #1B5E20 0%, #2E7D32 60%, #388E3C 100%);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.billiard-card-img img { width: 100%; height: 100%; object-fit: cover; }
.billiard-card-img-placeholder { font-size: 40px; opacity: 0.25; color: #fff; }
.billiard-card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.billiard-card-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.billiard-card-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.billiard-card-lesson { font-size: 13px; color: var(--text-mid); line-height: 1.5; flex: 1; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.billiard-card-footer { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.billiard-card-date { font-size: 11px; color: var(--text-light); }

/* ── Canvas / Annotation ─────────────────────────────────────────────── */
.canvas-wrap { background: #1a472a; border-radius: var(--radius); overflow: hidden; }
.canvas-toolbar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: rgba(0,0,0,0.3); flex-wrap: wrap; }
.tool-btn { padding: 6px 12px; border-radius: 6px; font-size: 12px; font-weight: 600; background: rgba(255,255,255,0.15); color: #fff; border: none; cursor: pointer; transition: background 0.15s; }
.tool-btn:hover, .tool-btn.active { background: var(--accent); }
.color-btn { width: 24px; height: 24px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.4); cursor: pointer; padding: 0; }
.color-btn.active { border-color: #fff; transform: scale(1.2); }
#annotation-canvas { display: block; width: 100%; cursor: crosshair; touch-action: none; }

/* ── Detail layout ───────────────────────────────────────────────────── */
.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }
.detail-section { margin-bottom: 24px; }
.detail-section h3 { font-size: 13px; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.detail-text { font-size: 14px; line-height: 1.7; color: var(--text-dark); white-space: pre-line; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Markdown ────────────────────────────────────────────────────────── */
.markdown-body { font-size: 14px; line-height: 1.8; color: var(--text-dark); }
.markdown-body h1 { font-size: 20px; margin: 20px 0 10px; }
.markdown-body h2 { font-size: 17px; margin: 16px 0 8px; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.markdown-body h3 { font-size: 15px; margin: 12px 0 6px; }
.markdown-body p { margin: 8px 0; }
.markdown-body ul, .markdown-body ol { padding-left: 20px; margin: 8px 0; }
.markdown-body li { margin: 4px 0; }
.markdown-body code { background: var(--bg); padding: 2px 6px; border-radius: 4px; font-size: 13px; font-family: monospace; }
.markdown-body pre { background: var(--bg); padding: 14px; border-radius: var(--radius-sm); overflow-x: auto; margin: 10px 0; }
.markdown-body blockquote { border-left: 3px solid var(--accent); padding-left: 14px; color: var(--text-mid); margin: 10px 0; }
.markdown-body strong { font-weight: 700; }
.markdown-body hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* ── Journal ─────────────────────────────────────────────────────────── */
.journal-card { background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); padding: 20px; transition: box-shadow 0.2s; display: flex; gap: 20px; }
.journal-card:hover { box-shadow: var(--shadow-md); }
.journal-date-block { text-align: center; min-width: 52px; }
.journal-date-month { font-size: 11px; color: var(--text-light); font-weight: 700; text-transform: uppercase; }
.journal-date-day { font-size: 28px; font-weight: 800; color: var(--primary); line-height: 1; }
.journal-date-year { font-size: 11px; color: var(--text-light); }
.journal-divider { width: 1px; background: var(--border); }
.journal-body { flex: 1; min-width: 0; }
.journal-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.journal-title { font-size: 15px; font-weight: 700; }
.journal-stats { display: flex; gap: 20px; flex-wrap: wrap; }
.journal-stat { text-align: center; }
.journal-stat-value { font-size: 18px; font-weight: 800; color: var(--text-dark); }
.journal-stat-label { font-size: 11px; color: var(--text-light); }

/* ── Note ─────────────────────────────────────────────────────────────── */
.note-card { background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); padding: 20px; transition: box-shadow 0.2s; border-left: 4px solid var(--primary); display: flex; flex-direction: column; gap: 8px; }
.note-card:hover { box-shadow: var(--shadow-md); }
.note-title { font-size: 15px; font-weight: 700; }
.note-preview { font-size: 13px; color: var(--text-mid); line-height: 1.6; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.note-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.note-date { font-size: 12px; color: var(--text-light); }

/* ── Coming Soon ─────────────────────────────────────────────────────── */
.coming-soon-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 80px 20px; text-align: center; }
.coming-soon-icon { font-size: 56px; margin-bottom: 20px; opacity: 0.3; }
.coming-soon-title { font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.coming-soon-text { font-size: 14px; color: var(--text-light); line-height: 1.6; }
.coming-soon-badge { margin-top: 20px; background: var(--primary); color: #fff; padding: 8px 24px; border-radius: 20px; font-size: 13px; font-weight: 700; display: inline-block; }

/* ── Login ──────────────────────────────────────────────────────────── */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--primary-dark); padding: 20px; }
.login-card { background: var(--bg-card); border-radius: 20px; padding: 48px 40px; width: 100%; max-width: 420px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo-icon { width: 64px; height: 64px; background: var(--primary); border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 28px; margin: 0 auto 12px; color: #fff; font-weight: 800; }
.login-logo h1 { font-size: 20px; font-weight: 800; }
.login-logo p { font-size: 13px; color: var(--text-light); margin-top: 4px; }
.login-form .btn-primary { width: 100%; justify-content: center; padding: 13px; font-size: 15px; margin-top: 8px; }

/* ── Image preview ───────────────────────────────────────────────────── */
.img-preview { width: 100%; max-height: 200px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); display: none; margin-top: 8px; }
.img-preview.show { display: block; }

/* ── YouTube ─────────────────────────────────────────────────────────── */
.yt-thumb { position: relative; border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 16/9; background: #000; }
.yt-thumb img { width: 100%; height: 100%; object-fit: cover; }
.yt-play-btn { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.3); transition: background 0.2s; }
.yt-play-btn:hover { background: rgba(0,0,0,0.5); }
.yt-play-icon { width: 52px; height: 52px; background: #FF0000; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.yt-play-icon::after { content: ''; border-left: 18px solid #fff; border-top: 11px solid transparent; border-bottom: 11px solid transparent; margin-left: 4px; }

/* ── Empty state ─────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state-icon { font-size: 48px; opacity: 0.2; margin-bottom: 16px; }
.empty-state-text { font-size: 15px; color: var(--text-light); font-weight: 600; margin-bottom: 16px; }

/* ── Average ─────────────────────────────────────────────────────────── */
.scoreboard { display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px; align-items: center; }
.score-side { text-align: center; }
.score-name { font-size: 18px; font-weight: 800; margin-bottom: 4px; }
.score-num { font-size: 56px; font-weight: 800; color: var(--primary); line-height: 1; }
.score-target { font-size: 14px; color: var(--text-light); }
.score-vs { font-size: 18px; font-weight: 700; color: var(--text-light); }
.avg-display { font-size: 12px; color: var(--text-mid); margin-top: 4px; }
.inning-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.inning-num { width: 32px; color: var(--text-light); font-weight: 600; font-size: 12px; }
.inning-pts { font-weight: 700; width: 40px; text-align: center; }
.inning-total { color: var(--text-light); font-size: 12px; margin-left: auto; }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-240px); width: 240px; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .main-wrapper { margin-left: 0; }
  .topbar-hamburger { display: block; }
  .content { padding: 16px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card-grid { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .form-grid-3 { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .journal-card { flex-direction: column; gap: 12px; }
  .journal-divider { display: none; }
  .scoreboard { gap: 10px; }
  .score-num { font-size: 40px; }
  .login-card { padding: 32px 24px; }
  .topbar { padding: 0 16px; }
}
@media (max-width: 480px) {
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar .form-control, .search-input { width: 100%; max-width: 100%; }
}

/* ── Utility ─────────────────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.flex  { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.w-100 { width: 100%; }
.hidden { display: none; }
.font-bold { font-weight: 700; }
.text-primary { color: var(--primary); }
.text-accent  { color: var(--accent); }
.text-light   { color: var(--text-light); }
.text-mid     { color: var(--text-mid); }

/* ── Quill WYSIWYG 스타일 ────────────────────────────────────────────────── */
.ql-toolbar.ql-snow {
  border: 1.5px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: var(--bg);
  font-family: 'Nanum Gothic', 'Apple SD Gothic Neo', sans-serif;
  padding: 8px 10px;
  flex-wrap: wrap;
  line-height: 1;
}
/* Quill 드롭다운 폰트 */
.ql-snow .ql-picker { font-family: 'Nanum Gothic', 'Apple SD Gothic Neo', sans-serif; font-size: 13px; }
.ql-snow .ql-picker-label { line-height: 1; padding: 0 4px; }
.ql-snow .ql-picker.ql-header .ql-picker-label::before,
.ql-snow .ql-picker.ql-header .ql-picker-item::before { font-family: 'Nanum Gothic', 'Apple SD Gothic Neo', sans-serif; }
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="2"]::before,
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before { content: '제목 2'; }
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="3"]::before,
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before { content: '제목 3'; }
.ql-snow .ql-picker.ql-header .ql-picker-label:not([data-value])::before,
.ql-snow .ql-picker.ql-header .ql-picker-item:not([data-value])::before { content: '본문'; }
.ql-container.ql-snow {
  border: 1.5px solid var(--border);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-family: 'Nanum Gothic', 'Apple SD Gothic Neo', sans-serif;
  font-size: 14px;
}
.ql-container.ql-snow:focus-within { border-color: var(--primary); }
.ql-toolbar.ql-snow:focus-within + .ql-container.ql-snow,
.ql-toolbar.ql-snow:focus-within { border-color: var(--primary); }
.ql-editor {
  min-height: 160px;
  line-height: 1.8;
  padding: 14px 16px;
  color: var(--text-dark);
}
.ql-editor.ql-blank::before {
  font-style: normal;
  color: var(--text-light);
  font-size: 14px;
}
.ql-snow .ql-stroke { stroke: var(--text-mid); }
.ql-snow .ql-fill { fill: var(--text-mid); }
.ql-snow.ql-toolbar button:hover .ql-stroke,
.ql-snow.ql-toolbar button.ql-active .ql-stroke { stroke: var(--primary); }
.ql-snow.ql-toolbar button:hover .ql-fill,
.ql-snow.ql-toolbar button.ql-active .ql-fill { fill: var(--primary); }
.ql-snow.ql-toolbar .ql-picker-label:hover,
.ql-snow.ql-toolbar .ql-picker-label.ql-active { color: var(--primary); }
.ql-snow.ql-toolbar button:hover,
.ql-snow.ql-toolbar button.ql-active {
  background: rgba(46,125,50,0.08);
  border-radius: 4px;
}
/* 이미지 버튼 — Quill 기본 SVG 아이콘 사용 (텍스트 제거) */

/* WYSIWYG 콘텐츠 표시 */
.wysiwyg-content {
  font-size: 14px;
  line-height: 1.9;
  color: var(--text-dark);
  word-break: break-word;
}
.wysiwyg-content h1 { font-size: 20px; font-weight: 800; margin: 18px 0 8px; }
.wysiwyg-content h2 { font-size: 17px; font-weight: 700; margin: 14px 0 6px; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.wysiwyg-content h3 { font-size: 15px; font-weight: 700; margin: 12px 0 4px; }
.wysiwyg-content p { margin: 6px 0; }
.wysiwyg-content ul, .wysiwyg-content ol { padding-left: 22px; margin: 6px 0; }
.wysiwyg-content li { margin: 4px 0; }
.wysiwyg-content strong { font-weight: 700; }
.wysiwyg-content em { font-style: italic; }
.wysiwyg-content u { text-decoration: underline; }
.wysiwyg-content img { max-width: 100%; border-radius: var(--radius-sm); margin: 8px 0; display: block; }
.wysiwyg-content a { color: var(--primary); text-decoration: underline; }
.wysiwyg-content blockquote { border-left: 3px solid var(--accent); padding-left: 14px; color: var(--text-mid); margin: 10px 0; font-style: italic; }
.wysiwyg-content pre { background: var(--bg); padding: 12px; border-radius: var(--radius-sm); font-size: 13px; overflow-x: auto; }

/* ── 우측 패널 컴포넌트 ──────────────────────────────────────────────────── */

/* 액션 패널 */
.rp-actions {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.rp-actions-title {
  padding: 14px 18px 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--border);
}
.rp-actions-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.rp-btn-edit {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px; border-radius: var(--radius-sm);
  background: var(--primary); color: #fff;
  font-size: 14px; font-weight: 700; border: none; cursor: pointer;
  transition: background .15s; text-align: center;
}
.rp-btn-edit:hover { background: var(--primary-light); }
.rp-btn-new {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px; border-radius: var(--radius-sm);
  background: transparent; color: var(--primary);
  border: 2px solid var(--primary);
  font-size: 13px; font-weight: 700; cursor: pointer;
  transition: all .15s; text-align: center;
}
.rp-btn-new:hover { background: var(--primary); color: #fff; }
.rp-btn-list {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px; border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text-mid);
  border: 1px solid var(--border);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all .15s; text-align: center;
}
.rp-btn-list:hover { border-color: var(--text-mid); }
.rp-btn-danger {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px; border-radius: var(--radius-sm);
  background: transparent; color: #C62828;
  border: 1px solid rgba(198,40,40,0.3);
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: all .15s; text-align: center;
}
.rp-btn-danger:hover { background: #FFEBEE; }

/* 메타 정보 패널 */
.rp-meta {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.rp-meta-header {
  padding: 14px 18px 10px;
  font-size: 11px; font-weight: 700;
  color: var(--text-light); text-transform: uppercase; letter-spacing: 1px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.rp-meta-body { padding: 14px 18px; display: flex; flex-direction: column; gap: 12px; }
.rp-meta-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
}
.rp-meta-label {
  font-size: 12px; font-weight: 700; color: var(--text-light);
  white-space: nowrap; padding-top: 2px;
}
.rp-meta-value {
  font-size: 13px; font-weight: 600; color: var(--text-dark);
  text-align: right; flex: 1;
}
.rp-meta-divider { height: 1px; background: var(--border); }

/* 강조 정보 박스 */
.rp-highlight {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #2d5f35 100%);
  border-radius: var(--radius);
  padding: 20px 18px;
  box-shadow: var(--shadow);
}
.rp-highlight-label {
  font-size: 11px; font-weight: 700; color: var(--accent);
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px;
}
.rp-highlight-value {
  font-size: 28px; font-weight: 800; color: #fff; line-height: 1;
}
.rp-highlight-sub {
  font-size: 12px; color: rgba(255,255,255,0.5); margin-top: 4px;
}

/* 통계 미니 카드 */
.rp-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rp-stat-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
  box-shadow: var(--shadow);
}
.rp-stat-value { font-size: 22px; font-weight: 800; color: var(--primary); line-height: 1; }
.rp-stat-label { font-size: 11px; color: var(--text-light); margin-top: 4px; font-weight: 600; }

/* 태그 패널 */
.rp-tags {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.rp-tags-header {
  padding: 14px 18px 10px;
  font-size: 11px; font-weight: 700;
  color: var(--text-light); text-transform: uppercase; letter-spacing: 1px;
  border-bottom: 1px solid var(--border); background: var(--bg);
}
.rp-tags-body { padding: 14px 18px; }

/* 관련 항목 패널 */
.rp-related {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.rp-related-header {
  padding: 14px 18px 10px;
  font-size: 11px; font-weight: 700;
  color: var(--text-light); text-transform: uppercase; letter-spacing: 1px;
  border-bottom: 1px solid var(--border); background: var(--bg);
}
.rp-related-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px; border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--text-dark);
  transition: background .12s;
}
.rp-related-item:last-child { border-bottom: none; }
.rp-related-item:hover { background: var(--bg); }
.rp-related-icon {
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
}

/* 진행률 바 */
.rp-progress-item { margin-bottom: 10px; }
.rp-progress-item:last-child { margin-bottom: 0; }
.rp-progress-label { display: flex; justify-content: space-between; margin-bottom: 4px; font-size: 12px; }
.rp-progress-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.rp-progress-fill { height: 100%; background: var(--primary); border-radius: 3px; transition: width .4s ease; }

/* 폼 개선 */
.form-section-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px; padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}
.form-section-icon {
  width: 32px; height: 32px; background: var(--primary);
  border-radius: 8px; display: flex; align-items: center;
  justify-content: center; color: #fff; font-size: 14px; flex-shrink: 0;
}
.form-section-header h3 { font-size: 14px; font-weight: 800; color: var(--text-dark); }
.form-section-header p { font-size: 12px; color: var(--text-light); margin-top: 1px; }

/* textarea 폰트 명시 */
textarea {
  font-family: 'Nanum Gothic', 'Apple SD Gothic Neo', sans-serif !important;
  font-size: 14px;
  line-height: 1.7;
}
input[type="text"], input[type="number"], input[type="date"],
input[type="url"], input[type="email"], input[type="password"] {
  font-family: 'Nanum Gothic', 'Apple SD Gothic Neo', sans-serif !important;
}
select {
  font-family: 'Nanum Gothic', 'Apple SD Gothic Neo', sans-serif !important;
}
