/* ===================================================================
   ITS MINE 통합 공통 스타일 (정리/통합 완전 버전)
   - 버튼, 카드, 입력, 헤더, 페이지 레이아웃 전면 통합
   - makelinker / printtemplates / qrPrint / printedlinkers 공통 UI 유지
=================================================================== */

/* -------------------------------------------------
   CSS 변수
--------------------------------------------------- */
:root {
  --color-primary: #8f5bb2;
  --color-primary-hover: #7a4d96;
  --color-primary-light: #f1e6f8;

  --color-secondary: #653b7d;
  --color-secondary-hover: #a64ea0;

  --color-white: #fff;
  --color-black: #000;

  --color-gray-100: #fafafa;
  --color-gray-200: #f5f5f5;
  --color-gray-300: #eee;
  --color-gray-400: #ccc;
  --color-gray-500: #999;
  --color-gray-700: #555;
  --color-gray-800: #333;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;

  --shadow-sm: 0 2px 4px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 6px 18px rgba(0,0,0,0.1);
}

/* -------------------------------------------------
   기본
--------------------------------------------------- */
body {
  margin: 0;
  background: var(--color-gray-100);
  font-family: "Noto Sans KR", sans-serif;
  color: #333;
}

/* -------------------------------------------------
   공통 페이지 레이아웃
--------------------------------------------------- */
.its-page-container {
  width: 100%;
  max-width: 1400px;
  margin: 40px auto;
  padding: 0 24px;
  box-sizing: border-box;
}

/* printedlinkers 와 같은 페이지 여백 통일 */
body.printedlinkers-page .its-page-container,
body.printtemplates-page .its-page-container,
body.qrprint-page .its-page-container,
body.makelinker-page .its-page-container {
  margin-top: 40px;
}

/* -------------------------------------------------
   상단 ITS MINE 헤더 (3페이지 공통)
--------------------------------------------------- */

.its-header.mk-header {
  width: 100%;
  padding: 48px 20px;
  text-align: center;
  background: linear-gradient(135deg, #8f5bb2, #a967c4);
  color: #fff;
  border-radius: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.its-header .title {
  margin: 0;
  font-size: 40px;
  font-weight: 800;
}

.its-header .subtitle {
  margin-top: 12px;
  font-size: 16px;
  opacity: 0.9;
}

/* -------------------------------------------------
   상단 네비게이션 통합 (ITS MINE)
--------------------------------------------------- */
.its-main-nav {
  width: 100%;
  background: linear-gradient(90deg,#7c4fa3,#8f5bb2);
  color: white;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-sizing: border-box;
}

.its-main-nav .brand {
  font-size: 18px;
  font-weight: 700;
}

.its-main-nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

.its-main-nav a:hover { opacity: 0.85; }

/* -------------------------------------------------
   관리자 메뉴 (공통)
--------------------------------------------------- */

.its-admin-topbar {
  width: 100%;
  padding: 8px 18px;
  background: linear-gradient(90deg,#7c4fa3,#8f5bb2);
  color: white;
  display: none;    /* 로그인 시 JS에서 show */
  position: sticky;
  top: 0;
  z-index: 999;
}

.its-admin-topbar .admin-inner {
  display: flex;
  gap: 12px;
}

.its-admin-topbar a,
.its-admin-topbar button {
  background: rgba(255,255,255,0.1);
  border: none;
  color:white;
  padding: 8px 14px;
  border-radius: 8px;
  text-decoration:none;
  cursor:pointer;
  font-weight:600;
}

.its-admin-topbar a:hover {
  background: rgba(255,255,255,0.15);
}

/* -------------------------------------------------
   카드 & 패널 UI
--------------------------------------------------- */

.card {
  background: white;
  padding: 32px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: 28px;
}

.card-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
}

/* -------------------------------------------------
   버튼
--------------------------------------------------- */

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  background: var(--color-primary);
  color: white;
  cursor: pointer;
  font-weight: 600;
  transition: 0.2s;
}
.btn:hover { background: var(--color-primary-hover); }

/* secondary */
.btn-secondary {
  background: white;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}
.btn-secondary:hover {
  background: var(--color-primary);
  color: white;
}

/* -------------------------------------------------
   템플릿 버튼
--------------------------------------------------- */
.template-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: white;
  border: 2px solid #d5d5f5;
  border-radius: 10px;
  cursor: pointer;
  transition: .2s;
}
.template-btn:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}
.template-btn.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}
.tpl-img { width: 48px; height: 48px; }

/* -------------------------------------------------
   QR 카드 (printtemplates, printedlinkers)
--------------------------------------------------- */
.qr-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid #ddd;
  width: 220px;
  text-align:center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.07);
}

/* -------------------------------------------------
   Print 페이지용 레이아웃
--------------------------------------------------- */
#print-pages-wrapper {
  background: white;
  padding: 16px;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}
#print-pages {
  width: 210mm;
  min-height:297mm;
  background:white;
  padding:5mm;
  display:flex;
  flex-wrap:wrap;
  gap:4mm;
  transform-origin:top left;
}
#print-pages.preview { transform: scale(0.47); }

/* A타입 */
body[data-template="atype"] .print-page {
  width: 30mm;
  height: 16mm;
  margin: 4mm;
  position:relative;
}
body[data-template="atype"] .qr-container {
  width:12mm; height:12mm;
  position:absolute; left:1mm; top:2mm;
}

/* 65x45 */
body[data-template="65x45"] .print-page {
  width:65mm; height:30mm;
}


/* -------------------------------------------------
   반응형
--------------------------------------------------- */
@media (max-width: 768px) {
  .its-header .title { font-size: 28px; }
  .its-header .subtitle { font-size: 14px; }
}
