/* ==========================================================================
   MAKIUM Brand Design Tokens — 마키움 공용 디자인 토큰
   3개 서비스(마키움 메인 9000, 플레이스 8123, 블로그 5948)에 동일 적용
   ========================================================================== */

/* Pretendard Variable — 한글 SaaS 표준 폰트 (logichackers.com 동일) */
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css");

:root {
  --mk-brand: #2563eb;
  --mk-brand-dark: #1e3a8a;
  --mk-brand-light: #3b82f6;
  --mk-brand-soft: #dbeafe;
  --mk-bg: #f8fafc;
  --mk-card: #ffffff;
  --mk-border: #e2e8f0;
  --mk-border-strong: #cbd5e1;
  --mk-text: #0f172a;
  --mk-text-sub: #64748b;
  --mk-text-mute: #94a3b8;
  --mk-success: #10b981;
  --mk-danger: #ef4444;
  --mk-warning: #f59e0b;
  --mk-radius: 10px;
  --mk-radius-lg: 16px;
  --mk-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --mk-shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.06);
  --mk-shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.1), 0 4px 6px -4px rgba(15, 23, 42, 0.08);
  --mk-space-1: 4px;
  --mk-space-2: 8px;
  --mk-space-3: 12px;
  --mk-space-4: 16px;
  --mk-space-5: 20px;
  --mk-space-6: 24px;
  --mk-space-8: 32px;
}

/* Font stack — Pretendard Variable 우선 */
.mk-font,
body.mk-font,
html.mk-font,
html.mk-font body {
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color: var(--mk-text);
}

/* Buttons */
.mk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 8px;
  font-weight: 600;
  padding: 10px 18px;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.4;
}
.mk-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.mk-btn-primary { background: var(--mk-brand); color: #fff; }
.mk-btn-primary:hover { background: var(--mk-brand-dark); }
.mk-btn-ghost {
  background: transparent;
  color: var(--mk-brand);
  border-color: var(--mk-brand);
}
.mk-btn-ghost:hover { background: var(--mk-brand); color: #fff; }
.mk-btn-danger { background: var(--mk-danger); color: #fff; }
.mk-btn-danger:hover { background: #b91c1c; }
.mk-btn-sm { padding: 6px 12px; font-size: 13px; }
.mk-btn-lg { padding: 14px 24px; font-size: 16px; }

/* Card */
.mk-card {
  background: var(--mk-card);
  border: 1px solid var(--mk-border);
  border-radius: var(--mk-radius);
  padding: var(--mk-space-5);
  box-shadow: var(--mk-shadow);
}
.mk-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--mk-text);
  margin: 0 0 var(--mk-space-3) 0;
}
.mk-card-sub {
  color: var(--mk-text-sub);
  font-size: 13px;
  line-height: 1.5;
}

/* Input + Select */
.mk-input, .mk-select, .mk-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--mk-border);
  border-radius: 8px;
  background: #fff;
  color: var(--mk-text);
  font-size: 14px;
  transition: all 0.15s ease;
}
.mk-input:focus, .mk-select:focus, .mk-textarea:focus {
  outline: none;
  border-color: var(--mk-brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.mk-textarea { min-height: 100px; resize: vertical; }
.mk-label {
  display: block;
  color: var(--mk-text-sub);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

/* Table */
.mk-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--mk-border);
  border-radius: var(--mk-radius);
  overflow: hidden;
}
.mk-table th, .mk-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--mk-border);
  font-size: 14px;
}
.mk-table th {
  background: var(--mk-bg);
  color: var(--mk-text-sub);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.mk-table tr:last-child td { border-bottom: none; }
.mk-table tr:hover td { background: #f1f5f9; }

/* Badge */
.mk-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--mk-brand-soft);
  color: var(--mk-brand-dark);
}
.mk-badge-success { background: #d1fae5; color: #065f46; }
.mk-badge-danger { background: #fee2e2; color: #991b1b; }
.mk-badge-warning { background: #fef3c7; color: #92400e; }
.mk-badge-ghost { background: #e2e8f0; color: #475569; }

/* Modal */
.mk-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
}
.mk-modal {
  background: #fff;
  border-radius: var(--mk-radius-lg);
  padding: 28px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--mk-shadow-lg);
}
.mk-modal-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: var(--mk-text);
}
.mk-modal-body {
  font-size: 14px;
  color: var(--mk-text-sub);
  line-height: 1.6;
  margin-bottom: 20px;
}
.mk-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Header / Top nav */
.mk-header {
  background: #fff;
  border-bottom: 1px solid var(--mk-border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--mk-shadow);
}
.mk-header-brand {
  font-size: 18px;
  font-weight: 800;
  color: var(--mk-brand);
  text-decoration: none;
}
.mk-header-nav { display: flex; gap: 14px; align-items: center; }
.mk-header-nav a {
  color: var(--mk-text-sub);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 6px;
}
.mk-header-nav a:hover { color: var(--mk-brand); background: var(--mk-brand-soft); }
.mk-header-nav a.active { color: var(--mk-brand); background: var(--mk-brand-soft); }

/* Promo banner (동일 디자인: 블로그/플레이스/메인 공용) */
.mk-promo {
  background: linear-gradient(135deg, var(--mk-brand) 0%, var(--mk-brand-dark) 100%);
  color: #fff;
  padding: 16px 24px;
  border-radius: var(--mk-radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: var(--mk-space-5);
  box-shadow: var(--mk-shadow-md);
  flex-wrap: wrap;
}
.mk-promo-title {
  font-size: 16px;
  font-weight: 800;
  margin: 0 0 4px 0;
}
.mk-promo-sub {
  font-size: 13px;
  opacity: 0.9;
  margin: 0;
  line-height: 1.5;
}
.mk-promo-cta {
  background: #fff;
  color: var(--mk-brand);
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
}
.mk-promo-cta:hover { background: var(--mk-brand-soft); }

/* Utility */
.mk-flex { display: flex; }
.mk-flex-col { display: flex; flex-direction: column; }
.mk-gap-2 { gap: 8px; }
.mk-gap-3 { gap: 12px; }
.mk-gap-4 { gap: 16px; }
.mk-grid { display: grid; }
.mk-w-full { width: 100%; }
.mk-text-sub { color: var(--mk-text-sub); }
.mk-text-brand { color: var(--mk-brand); }
.mk-bg-soft { background: var(--mk-bg); }
.mk-hidden { display: none !important; }

/* Masked / Sample overlay for guest mode */
.mk-sample-overlay {
  position: relative;
}
.mk-sample-overlay::before {
  content: "로그인 후 실제 데이터를 확인할 수 있습니다";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(2px);
  color: var(--mk-brand-dark);
  font-weight: 700;
  font-size: 14px;
  z-index: 5;
  border-radius: inherit;
  pointer-events: none;
}

/* ==========================================================================
   logichackers.com 레퍼런스 기반 — 섹션/페이지 헤더/툴바/패널 보강
   ========================================================================== */

/* Page header (대시보드 타이틀 영역) */
.mk-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: var(--mk-space-6);
  padding-bottom: var(--mk-space-4);
  border-bottom: 1px solid var(--mk-border);
}
.mk-page-header h1, .mk-page-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--mk-text);
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.mk-page-subtitle {
  font-size: 14px;
  color: var(--mk-text-sub);
  line-height: 1.5;
}
.mk-page-actions { display:flex; gap:8px; flex-wrap:wrap; }

/* Section heading (작은 타이틀) */
.mk-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--mk-text-sub);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 var(--mk-space-3) 0;
}

/* Toolbar (필터바 / 툴바) */
.mk-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  background: var(--mk-card);
  border: 1px solid var(--mk-border);
  border-radius: var(--mk-radius);
  margin-bottom: var(--mk-space-4);
}
.mk-toolbar .mk-input, .mk-toolbar .mk-select { min-width: 160px; width: auto; flex: 0 1 220px; }
.mk-toolbar-spacer { flex: 1 1 auto; }

/* Panel — mk-card 의 간결한 변형 (logichackers 카드 느낌) */
.mk-panel {
  background: var(--mk-card);
  border: 1px solid var(--mk-border);
  border-radius: var(--mk-radius);
  padding: var(--mk-space-5);
  box-shadow: var(--mk-shadow);
}
.mk-panel + .mk-panel { margin-top: var(--mk-space-4); }
.mk-panel-head {
  display:flex; justify-content:space-between; align-items:flex-start;
  gap: 12px; margin-bottom: var(--mk-space-3);
}
.mk-panel-head h2, .mk-panel-title {
  font-size: 15px; font-weight: 700; color: var(--mk-text); margin: 0;
}
.mk-panel-sub { font-size: 12px; color: var(--mk-text-sub); margin-top: 2px; }

/* Ghost / soft pill — logichackers hover 스타일 */
.mk-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--mk-brand-soft); color: var(--mk-brand-dark);
  font-size: 12px; font-weight: 700;
}
.mk-pill-muted { background: #eef2f7; color: var(--mk-text-sub); }
.mk-pill-success { background: #d1fae5; color: #065f46; }
.mk-pill-danger { background: #fee2e2; color: #991b1b; }

/* Empty state */
.mk-empty {
  text-align: center; padding: 36px 24px;
  color: var(--mk-text-mute); font-size: 13px;
  background: var(--mk-card); border: 1px dashed var(--mk-border);
  border-radius: var(--mk-radius);
}

/* Stat (간단한 KPI 카드) */
.mk-stat {
  background: var(--mk-card); border: 1px solid var(--mk-border);
  border-radius: var(--mk-radius); padding: 16px;
}
.mk-stat-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--mk-text-sub); margin-bottom: 6px;
}
.mk-stat-value {
  font-size: 24px; font-weight: 800; color: var(--mk-text); letter-spacing: -0.01em;
}
.mk-stat-delta { font-size: 12px; font-weight: 600; margin-top: 4px; }
.mk-stat-delta.up { color: var(--mk-success); }
.mk-stat-delta.down { color: var(--mk-danger); }

/* Subtle link button — logichackers 사이드바 항목 느낌 */
.mk-link-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 8px;
  color: var(--mk-text-sub); font-size: 13px; font-weight: 600;
  text-decoration: none; transition: all .15s ease;
  background: transparent; border: 0; cursor: pointer;
}
.mk-link-btn:hover { background: var(--mk-brand-soft); color: var(--mk-brand-dark); }
.mk-link-btn.active { background: #E7F1FF; color: #0050CC; }
