/* ── 리셋 & 변수 ────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #1A3764;
  --accent: #2B579A;
  --accent-light: #E8EDF3;
  --bg: #F7F8FA;
  --surface: #FFFFFF;
  --text: #222222;
  --text-secondary: #666666;
  --text-muted: #999999;
  --border: #E2E5EA;
  --border-light: #F0F1F3;
  --success: #2E7D32;
  --danger: #D4563A;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --transition: 0.2s ease;
  --font: 'Malgun Gothic', 'Apple SD Gothic Neo', -apple-system, sans-serif;
}

html { font-size: 15px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── 헤더 ────────────────────────────────────────── */
.header {
  background: var(--primary);
  color: white;
  padding: 0 2rem;
  height: 68px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(26,55,100,0.25);
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  max-width: 560px;
  justify-content: flex-end;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.logo-icon {
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.15);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.logo h1 { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.02em; }
.logo-sub { font-size: 0.7rem; opacity: 0.6; margin-top: -2px; }

.search-wrap {
  position: relative;
  flex: 1;
  max-width: 480px;
}
.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}
.search-wrap input {
  width: 100%;
  height: 42px;
  border: none;
  border-radius: 8px;
  padding: 0 40px 0 42px;
  font-size: 0.93rem;
  font-family: var(--font);
  background: rgba(255,255,255,0.95);
  color: var(--text);
  outline: none;
  transition: box-shadow var(--transition);
}
.search-wrap input:focus {
  box-shadow: 0 0 0 3px rgba(255,255,255,0.3);
}
.search-wrap input::placeholder { color: #aaa; }
.search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 1.3rem;
  color: #999;
  cursor: pointer;
  display: none;
  padding: 4px 8px;
  line-height: 1;
}
.search-clear:hover { color: #666; }

/* ── 로그아웃 버튼 ──────────────────────────────── */
.btn-logout {
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.9);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: all var(--transition);
  flex-shrink: 0;
}
.btn-logout:hover {
  background: rgba(255,255,255,0.22);
  color: white;
}

/* ── 로그인 게이트 ──────────────────────────────── */
.login-gate {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #1A3764 0%, #2B579A 50%, #3A6BC5 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 2rem;
}
.login-card {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  width: 100%;
  max-width: 440px;
  overflow: hidden;
}
.login-header {
  text-align: center;
  padding: 2.5rem 2rem 1.5rem;
  background: linear-gradient(180deg, #f8f9fb 0%, white 100%);
  border-bottom: 1px solid var(--border-light);
}
.login-logo {
  width: 64px;
  height: 64px;
  background: var(--primary);
  color: white;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  box-shadow: 0 4px 12px rgba(26,55,100,0.3);
}
.login-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.3rem;
}
.login-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.login-loading {
  padding: 3rem 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.login-footer-text {
  margin-top: 1.5rem;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.5);
  text-align: center;
}

/* ── 인증 폼 섹션 ──────────────────────────────── */
.auth-section {
  padding: 1.5rem 2rem;
}
.auth-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.3rem;
}
.auth-section-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.auth-field {
  margin-bottom: 0.7rem;
}
.auth-field input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 14px;
  font-size: 0.93rem;
  font-family: var(--font);
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.auth-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(43,87,154,0.12);
}
.auth-field input::placeholder {
  color: #bbb;
}
.auth-error {
  font-size: 0.8rem;
  color: var(--danger);
  min-height: 1.2rem;
  margin-bottom: 0.3rem;
}
.auth-btn {
  width: 100%;
  height: 44px;
  font-size: 0.95rem;
  justify-content: center;
}
.auth-divider {
  display: flex;
  align-items: center;
  padding: 0 2rem;
}
.auth-divider span {
  flex-shrink: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 0 1rem;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── 코드 찾기 ──────────────────────────────────── */
.auth-find-box {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 1rem;
  padding: 12px 16px;
  background: var(--accent-light);
  border: 1.5px solid var(--accent);
  border-radius: 10px;
  color: var(--accent);
  font-size: 0.88rem;
  cursor: pointer;
  transition: all var(--transition);
}
.auth-find-box:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.auth-find-box:hover svg { stroke: white; }
.auth-find-box strong {
  font-weight: 700;
}
.code-finder-panel {
  margin-top: 0.8rem;
  padding: 1rem;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.finder-msg {
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-align: center;
  padding: 0.6rem 0;
}
.finder-msg.finder-error { color: var(--danger); }
.finder-list {
  list-style: none;
  margin-top: 0.6rem;
}
.finder-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border-light);
}
.finder-item:last-child { border-bottom: none; }
.finder-company {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}
.finder-code {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: monospace;
}
.finder-use-btn {
  flex-shrink: 0;
  padding: 0.25rem 0.7rem;
  font-size: 0.75rem;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  border: none;
  cursor: pointer;
}
.finder-use-btn:hover { background: var(--primary); }

/* ── 회사 정보 배너 ──────────────────────────────── */
.company-banner {
  background: var(--accent-light);
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 2rem;
}
.company-banner-inner {
  max-width: 1400px;
  margin: 0 auto;
}
.company-info-display {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.company-label { font-size: 0.85rem; color: var(--accent); }
.company-info-set {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.company-info-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.company-set-icon {
  color: var(--accent);
  flex-shrink: 0;
}
.company-name-display {
  font-weight: 700;
  color: var(--primary);
  font-size: 1rem;
}
.company-divider {
  color: var(--border);
  font-size: 0.85rem;
}
.company-detail-display {
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.btn-company-edit {
  background: white;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  font-weight: 600;
  border-radius: 6px;
  padding: 5px 14px;
  font-size: 0.8rem;
  transition: all var(--transition);
}
.btn-company-edit:hover {
  background: var(--accent);
  color: white;
}
.company-edit-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: auto;
}

/* ── 버튼 ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-sm { padding: 6px 14px; font-size: 0.8rem; border-radius: 6px; }
.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover { background: var(--primary); }
.btn-secondary {
  background: var(--border-light);
  color: var(--text-secondary);
}
.btn-secondary:hover { background: var(--border); }
.btn-outline {
  background: white;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-outline:hover { background: var(--accent); color: white; }
.btn-ghost {
  background: transparent;
  color: var(--accent);
  padding: 6px 10px;
  font-size: 0.8rem;
}
.btn-ghost:hover { background: rgba(43,87,154,0.08); }

/* ── 메인 레이아웃 ────────────────────────────────── */
.main {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  gap: 2rem;
  padding: 1.5rem 2rem;
  min-height: calc(100vh - 68px - 44px);
}

/* ── 사이드바 ────────────────────────────────────── */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  position: sticky;
  top: 84px;
  align-self: flex-start;
}
.sidebar-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.6rem;
  padding-left: 0.5rem;
}
.cat-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-family: var(--font);
  font-size: 0.88rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
  margin-bottom: 2px;
}
.cat-btn:hover { background: var(--accent-light); color: var(--primary); }
.cat-btn.active {
  background: var(--accent);
  color: white;
  font-weight: 600;
}
.cat-btn.active .cat-count { background: rgba(255,255,255,0.25); color: white; }
.cat-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cat-count {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--border-light);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 10px;
}

/* ── 콘텐츠 영역 ──────────────────────────────────── */
.content { flex: 1; min-width: 0; }
.content-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1.2rem;
}
.content-header h2 { font-size: 1.15rem; color: var(--primary); }
.result-count {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ── 양식 카드 그리드 ──────────────────────────────── */
.forms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  transition: all var(--transition);
  overflow: hidden;
}
.form-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

/* -- 카드 본문 (클릭 시 모달) -- */
.form-card-body {
  padding: 1.1rem 1.2rem 0.8rem;
  cursor: pointer;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.form-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.form-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}
.form-card-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}
.form-card-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.form-card-meta {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.form-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.tag {
  font-size: 0.68rem;
  color: var(--text-muted);
  background: var(--border-light);
  padding: 2px 7px;
  border-radius: 4px;
}
.form-card-legal {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* -- 카드 하단 버튼 영역 -- */
.form-card-actions {
  display: flex;
  border-top: 1px solid var(--border-light);
}
.btn-card-detail,
.btn-card-download {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 8px;
  border: none;
  background: none;
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
  color: var(--text-secondary);
}
.btn-card-detail {
  border-right: 1px solid var(--border-light);
}
.btn-card-detail:hover {
  background: var(--accent-light);
  color: var(--accent);
}
.btn-card-download {
  color: var(--accent);
}
.btn-card-download:hover {
  background: var(--accent);
  color: white;
}
.btn-card-download:disabled,
.btn-card-detail:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-loading {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ── 빈 상태 ──────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}
.empty-state p { margin-top: 0.8rem; font-size: 1rem; }
.empty-sub { font-size: 0.85rem !important; color: #bbb; }

/* ── 모달 ────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.modal-overlay.active { display: flex; }

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s ease;
}
.modal-sm { max-width: 480px; }

@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 1.15rem; color: var(--primary); }
.modal-category { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.modal-close:hover { color: var(--text); }

.modal-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  flex: 1;
}
.modal-section {
  margin-bottom: 1.2rem;
}
.modal-section:last-child { margin-bottom: 0; }
.modal-section h3 {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--accent-light);
}
.modal-section > p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.modal-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.legal-basis {
  font-size: 0.78rem !important;
  color: var(--accent) !important;
  margin-top: 0.5rem;
  font-style: italic;
}
.legal-risk {
  font-size: 0.78rem;
  color: #b45309;
  background: #fef3c7;
  border-left: 3px solid #f59e0b;
  padding: 0.5rem 0.75rem;
  margin-top: 0.5rem;
  border-radius: 4px;
  line-height: 1.5;
}

.field-row {
  margin-bottom: 0.7rem;
}
.field-row label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.required { color: var(--danger); }

.field-row input,
.field-row select {
  width: 100%;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 12px;
  font-size: 0.88rem;
  font-family: var(--font);
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--transition);
}
.field-row input:focus,
.field-row select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(43,87,154,0.1);
}

/* ── 이미지 업로드 ──────────────────────────────────── */
.image-upload-area {
  border: 2px dashed var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color var(--transition);
  cursor: pointer;
}
.image-upload-area:hover { border-color: var(--accent); }
.image-upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 1.2rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}
.upload-hint { font-size: 0.7rem; color: #bbb; }
.image-preview-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: #fafafa;
}
.image-preview-wrap img {
  max-width: 160px;
  max-height: 100px;
  object-fit: contain;
  border-radius: 4px;
}
.image-remove-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: var(--danger);
  color: white;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.image-remove-btn:hover { background: #b33a26; }

/* ── 도장 생성 ─────────────────────────────────────── */
.stamp-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.btn-sm {
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem;
  border-radius: 5px;
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-stamp-gen {
  border-color: #CC3333;
  color: #CC3333;
}
.btn-stamp-gen:hover {
  background: #CC3333;
  color: white;
}
.stamp-generator-modal {
  margin-top: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
}
.stamp-gen-content {
  padding: 0;
}
.stamp-tab-bar {
  display: flex;
  border-bottom: 2px solid var(--border-light);
}
.stamp-tab {
  flex: 1;
  padding: 0.6rem 0.8rem;
  border: none;
  background: transparent;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
}
.stamp-tab:hover { color: var(--text-primary); }
.stamp-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.stamp-tab-panel {
  display: none;
  padding: 1rem 1.2rem;
}
.stamp-tab-panel.active { display: block; }
.stamp-gen-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.stamp-gen-form .field-row {
  padding: 0;
}
.stamp-color-picks {
  display: flex;
  gap: 10px;
  align-items: center;
}
.stamp-color-pick {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  padding: 0;
  outline: none;
}
.stamp-color-pick:hover {
  transform: scale(1.15);
}
.stamp-color-pick.active {
  border-color: var(--text-primary);
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--text-muted);
}
.stamp-gen-preview {
  display: flex;
  justify-content: center;
  padding: 1rem 0;
}
.stamp-gen-preview canvas {
  width: 180px;
  height: 180px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: white;
}
.stamp-gen-actions {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-light);
}

/* ── 도장 직접 그리기 ─────────────────────────────── */
.stamp-draw-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: flex-end;
  margin-bottom: 0.8rem;
}
.draw-tool-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.draw-tool-group label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}
.draw-tool-group .draw-tool-btn,
.draw-tool-group .draw-color-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.draw-tool-group > div,
.draw-tool-group > span { display: inline-flex; align-items: center; gap: 4px; }
.draw-tool-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition);
}
.draw-tool-btn:hover { border-color: var(--accent); color: var(--accent); }
.draw-tool-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.draw-color-picks { display: flex; gap: 4px; }
.draw-color-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
}
.draw-color-btn:hover { transform: scale(1.15); }
.draw-color-btn.active { border-color: var(--text-primary); box-shadow: 0 0 0 2px var(--surface); }
.draw-range {
  width: 80px;
  accent-color: var(--accent);
}
#drawBrushSizeVal {
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 18px;
  text-align: center;
}
.stamp-draw-area {
  display: flex;
  justify-content: center;
  padding: 0.5rem 0;
}
.stamp-draw-area canvas {
  width: 250px;
  height: 250px;
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: crosshair;
  background: white;
  touch-action: none;
}
.stamp-draw-hint {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
}

/* ── 반응형 ──────────────────────────────────────── */
@media (max-width: 900px) {
  .main { flex-direction: column; padding: 1rem; }
  .sidebar {
    width: 100%;
    position: static;
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    gap: 4px;
    padding-bottom: 0.5rem;
  }
  .sidebar-title { display: none; }
  .cat-btn { white-space: nowrap; flex-shrink: 0; }
  .forms-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  .header { padding: 0 1rem; }
  .company-banner { padding: 0.5rem 1rem; }
  .company-edit-hint { display: none; }
  .company-info-set { gap: 0.5rem; }
}

@media (max-width: 600px) {
  html { font-size: 14px; }
  .header-inner { flex-direction: column; gap: 0.5rem; height: auto; padding: 0.75rem 0; }
  .header-right { max-width: 100%; width: 100%; }
  .search-wrap { max-width: none; flex: 1; }
  .logout-label { display: none; }
  .btn-logout { padding: 6px 8px; }
  .forms-grid { grid-template-columns: 1fr; }
  .modal { max-height: 90vh; margin: 1rem; }
  .login-card { margin: 0 0.5rem; }
  .auth-section { padding: 1.2rem 1.5rem; }
}
