/* ============================================
   LABSMRO 견적 관리 시스템 - 프리미엄 다크 모드 스타일시트
   ============================================ */

/* ── CSS 변수 (디자인 토큰) ── */
:root {
  /* 배경 색상 */
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-tertiary: #1e293b;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --bg-input: rgba(255, 255, 255, 0.06);
  --bg-input-focus: rgba(255, 255, 255, 0.1);

  /* 글라스모피즘 */
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-blur: blur(20px);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);

  /* 브랜드 색상 */
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-glow: rgba(59, 130, 246, 0.3);
  --primary-light: rgba(59, 130, 246, 0.15);
  --success: #22c55e;
  --success-hover: #16a34a;
  --success-glow: rgba(34, 197, 94, 0.3);
  --success-light: rgba(34, 197, 94, 0.15);
  --warning: #f59e0b;
  --warning-hover: #d97706;
  --warning-glow: rgba(245, 158, 11, 0.3);
  --warning-light: rgba(245, 158, 11, 0.15);
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --danger-glow: rgba(239, 68, 68, 0.3);
  --danger-light: rgba(239, 68, 68, 0.15);
  --info: #06b6d4;
  --info-light: rgba(6, 182, 212, 0.15);

  /* 텍스트 색상 */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0f172a;

  /* 간격 */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* 테두리 반경 */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* 타이포그래피 */
  --font-family: 'Inter', 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-xs: 0.75rem;
  --font-sm: 0.8125rem;
  --font-base: 0.875rem;
  --font-md: 1rem;
  --font-lg: 1.125rem;
  --font-xl: 1.25rem;
  --font-2xl: 1.5rem;
  --font-3xl: 2rem;

  /* 레이아웃 */
  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
  --header-height: 60px;

  /* 트랜지션 */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* z-index 레이어 */
  --z-sidebar: 100;
  --z-header: 200;
  --z-modal: 1000;
  --z-toast: 1100;
}

/* ── 라이트 모드 ── */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-tertiary: #e2e8f0;
  --bg-card: rgba(255, 255, 255, 0.8);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  --bg-input: rgba(0, 0, 0, 0.04);
  --bg-input-focus: rgba(0, 0, 0, 0.06);

  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(0, 0, 0, 0.1);
  --glass-blur: blur(20px);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #f1f5f9;
}

[data-theme="light"] body {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #f1f5f9 100%);
  color: var(--text-primary);
}

[data-theme="light"] .sidebar {
  background: rgba(255, 255, 255, 0.92);
  border-right: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .sidebar-nav-item {
  color: var(--text-secondary);
}

[data-theme="light"] .sidebar-nav-item:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
}

[data-theme="light"] .sidebar-nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
}

[data-theme="light"] .header {
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .btn-ghost {
  border-color: rgba(0, 0, 0, 0.12);
  color: var(--text-secondary);
}

[data-theme="light"] .btn-ghost:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
  border-color: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .form-input,
[data-theme="light"] .form-select,
[data-theme="light"] .form-textarea {
  background: var(--bg-input);
  border-color: rgba(0, 0, 0, 0.12);
  color: var(--text-primary);
}

[data-theme="light"] .form-input:focus,
[data-theme="light"] .form-select:focus,
[data-theme="light"] .form-textarea:focus {
  background: white;
  border-color: var(--primary);
}

[data-theme="light"] .form-input::placeholder {
  color: #94a3b8;
}

[data-theme="light"] .table thead th {
  background: rgba(0, 0, 0, 0.03);
  color: var(--text-secondary);
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .table tbody tr {
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .table tbody tr:hover {
  background: rgba(59, 130, 246, 0.04);
}

[data-theme="light"] .modal-overlay {
  background: rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .modal-content {
  background: white;
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .toast {
  background: white;
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
  color: var(--text-primary);
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .stat-card {
  border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .login-card {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .header-logout-btn {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.15);
}

[data-theme="light"] .sidebar-footer {
  border-top-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .theme-toggle {
  color: var(--text-secondary);
}

[data-theme="light"] .theme-toggle:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-primary);
}

/* ── 리셋 및 기본 스타일 ── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, #0d1525 100%);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-hover);
}

img {
  max-width: 100%;
  height: auto;
}

/* 스크롤바 커스텀 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ── 키프레임 애니메이션 ── */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes gradientMove {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ── 레이아웃 ── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.main-content {
  margin-left: var(--sidebar-width);
  margin-top: var(--header-height);
  padding: var(--space-xl);
  flex: 1;
  min-height: calc(100vh - var(--header-height));
  animation: fadeIn 0.3s ease;
}

.page-container {
  max-width: 1400px;
  margin: 0 auto;
  animation: fadeInUp 0.4s ease;
}

/* ── 사이드바 ── */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--glass-border);
  z-index: var(--z-sidebar);
  display: flex;
  flex-direction: column;
  transition: width var(--transition-normal), transform var(--transition-normal);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-logo {
  padding: var(--space-lg) var(--space-lg);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  min-height: var(--header-height);
}

.sidebar-logo img {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
}

.sidebar-logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), #6366f1);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: var(--font-lg);
  color: white;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-size: var(--font-lg);
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.sidebar-logo-sub {
  font-size: var(--font-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

.sidebar-nav {
  padding: var(--space-md) var(--space-sm);
  flex: 1;
}

.sidebar-section-title {
  font-size: var(--font-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: var(--space-lg) var(--space-md) var(--space-sm);
  font-weight: 600;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 10px var(--space-md);
  margin: 2px 0;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  white-space: nowrap;
  font-size: var(--font-base);
  font-weight: 500;
}

.sidebar-nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.sidebar-nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
}

.sidebar-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--primary);
  border-radius: 0 2px 2px 0;
}

.sidebar-nav-item svg,
.sidebar-nav-item .nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
}

.sidebar-nav-item:hover svg,
.sidebar-nav-item.active svg {
  opacity: 1;
}

.sidebar-divider {
  height: 1px;
  background: var(--glass-border);
  margin: var(--space-md) var(--space-md);
}

/* 사이드바 푸터 */
.sidebar-footer {
  padding: var(--space-sm) var(--space-sm);
  border-top: 1px solid var(--glass-border);
  margin-top: auto;
}

.theme-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 10px var(--space-md);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: var(--font-base);
  font-weight: 500;
  user-select: none;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.theme-toggle .theme-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ── 헤더 ── */
.header {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--header-height);
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  z-index: var(--z-header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-xl);
  transition: left var(--transition-normal);
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.header-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.header-menu-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.header-menu-toggle svg {
  width: 22px;
  height: 22px;
}

.header-title {
  font-size: var(--font-lg);
  font-weight: 600;
  color: var(--text-primary);
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.header-user {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.header-user-name {
  font-size: var(--font-base);
  font-weight: 500;
  color: var(--text-primary);
}

.header-user-role {
  font-size: var(--font-xs);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.header-logout-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--font-sm);
  font-weight: 500;
  font-family: var(--font-family);
  transition: all var(--transition-fast);
}

.header-logout-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.3);
}

.header-logout-btn svg {
  width: 16px;
  height: 16px;
}

/* ── 버튼 ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: var(--font-base);
  font-weight: 600;
  font-family: var(--font-family);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  line-height: 1.4;
  position: relative;
  overflow: hidden;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: var(--font-sm);
}

.btn-sm svg {
  width: 14px;
  height: 14px;
}

.btn-lg {
  padding: 12px 28px;
  font-size: var(--font-md);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #2563eb);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 6px 25px var(--primary-glow);
  transform: translateY(-1px);
}

.btn-success {
  background: linear-gradient(135deg, var(--success), #16a34a);
  color: white;
  border-color: var(--success);
  box-shadow: 0 4px 15px var(--success-glow);
}

.btn-success:hover:not(:disabled) {
  background: linear-gradient(135deg, #16a34a, #15803d);
  box-shadow: 0 6px 25px var(--success-glow);
  transform: translateY(-1px);
}

.btn-warning {
  background: linear-gradient(135deg, var(--warning), #d97706);
  color: white;
  border-color: var(--warning);
  box-shadow: 0 4px 15px var(--warning-glow);
}

.btn-warning:hover:not(:disabled) {
  background: linear-gradient(135deg, #d97706, #b45309);
  box-shadow: 0 6px 25px var(--warning-glow);
  transform: translateY(-1px);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #dc2626);
  color: white;
  border-color: var(--danger);
  box-shadow: 0 4px 15px var(--danger-glow);
}

.btn-danger:hover:not(:disabled) {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  box-shadow: 0 6px 25px var(--danger-glow);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--glass-border);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-icon {
  padding: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

/* 버튼 로딩 상태 */
.btn-loading {
  pointer-events: none;
  opacity: 0.7;
}

.btn-loading::after {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: 8px;
}

/* ── 카드 ── */
.card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--glass-shadow);
  transition: all var(--transition-normal);
  animation: fadeInUp 0.4s ease;
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--glass-border);
}

.card-title {
  font-size: var(--font-lg);
  font-weight: 700;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ── 스탯 카드 ── */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.stat-card {
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all var(--transition-normal);
  cursor: default;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.15;
  border-radius: var(--radius-lg);
}

.stat-card-gray {
  background: linear-gradient(135deg, rgba(100, 116, 139, 0.2), rgba(71, 85, 105, 0.1));
}
.stat-card-gray::before { background: linear-gradient(135deg, #64748b, #475569); }

.stat-card-blue {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(37, 99, 235, 0.1));
}
.stat-card-blue::before { background: linear-gradient(135deg, #3b82f6, #2563eb); }

.stat-card-green {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(22, 163, 74, 0.1));
}
.stat-card-green::before { background: linear-gradient(135deg, #22c55e, #16a34a); }

.stat-card-red {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(220, 38, 38, 0.1));
}
.stat-card-red::before { background: linear-gradient(135deg, #ef4444, #dc2626); }

.stat-card-amber {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.1));
}
.stat-card-amber::before { background: linear-gradient(135deg, #f59e0b, #d97706); }

.stat-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-md);
  background: rgba(255, 255, 255, 0.1);
}

.stat-card-icon svg {
  width: 22px;
  height: 22px;
  color: var(--text-primary);
}

.stat-card-value {
  font-size: var(--font-3xl);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 4px;
}

.stat-card-label {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  font-weight: 500;
}

/* ── 테이블 ── */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--font-base);
}

.table thead th {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: var(--font-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--glass-border);
  white-space: nowrap;
  position: sticky;
  top: 0;
}

.table thead th:first-child {
  border-radius: var(--radius-md) 0 0 0;
}

.table thead th:last-child {
  border-radius: 0 var(--radius-md) 0 0;
}

.table tbody tr {
  transition: background var(--transition-fast);
}

.table tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

.table tbody tr.clickable {
  cursor: pointer;
}

.table tbody tr.clickable:hover {
  background: rgba(59, 130, 246, 0.08);
}

.table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  vertical-align: middle;
}

.table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.table tbody tr:nth-child(even):hover {
  background: rgba(255, 255, 255, 0.05);
}

.table-empty {
  text-align: center;
  padding: var(--space-2xl) !important;
  color: var(--text-muted) !important;
}

.table-empty-icon {
  font-size: 48px;
  margin-bottom: var(--space-md);
  opacity: 0.3;
}

.text-right {
  text-align: right !important;
}

.text-center {
  text-align: center !important;
}

/* ── 배지 ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: var(--font-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge-draft {
  background: rgba(100, 116, 139, 0.2);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.3);
}

.badge-sent {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-won {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-lost {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-hold {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-active {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-inactive {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-admin {
  background: rgba(139, 92, 246, 0.2);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

/* ── 폼 요소 ── */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-label .required {
  color: var(--danger);
  margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  font-size: var(--font-base);
  font-family: var(--font-family);
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  outline: none;
  transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  background: var(--bg-input-focus);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-input:disabled,
.form-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.form-select option {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-input-icon {
  position: relative;
}

.form-input-icon .form-input {
  padding-left: 42px;
}

.form-input-icon svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

.form-grid-full {
  grid-column: 1 / -1;
}

.form-hint {
  font-size: var(--font-xs);
  color: var(--text-muted);
  margin-top: 4px;
}

.form-error {
  font-size: var(--font-xs);
  color: var(--danger);
  margin-top: 4px;
}

/* ── 검색 바 ── */
.search-bar {
  display: flex;
  gap: var(--space-md);
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
  padding: var(--space-lg);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
}

.search-bar .form-group {
  margin-bottom: 0;
  flex: 1;
  min-width: 180px;
}

.search-bar .btn {
  flex-shrink: 0;
}

/* ── 페이지네이션 ── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-xl);
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  font-size: var(--font-sm);
  font-weight: 500;
  font-family: var(--font-family);
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pagination-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.pagination-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.pagination-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.pagination-info {
  font-size: var(--font-sm);
  color: var(--text-muted);
  margin: 0 var(--space-md);
}

/* ── 모달 ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  animation: scaleIn 0.2s ease;
}

.modal-sm { max-width: 400px; }
.modal-md { max-width: 560px; }
.modal-lg { max-width: 720px; }
.modal-xl { max-width: 960px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--space-lg) var(--space-md);
  border-bottom: 1px solid var(--glass-border);
}

.modal-title {
  font-size: var(--font-lg);
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  font-size: 20px;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.modal-body {
  padding: var(--space-lg);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg) var(--space-lg);
  border-top: 1px solid var(--glass-border);
}

/* ── 토스트 알림 ── */
#toast-container {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-lg);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 14px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  font-size: var(--font-base);
  color: var(--text-primary);
  pointer-events: auto;
  animation: slideInRight 0.3s ease;
  max-width: 400px;
  backdrop-filter: var(--glass-blur);
}

.toast.removing {
  animation: slideOutRight 0.3s ease forwards;
}

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
  font-weight: 500;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
  font-size: 16px;
}

.toast-close:hover {
  color: var(--text-primary);
}

.toast-success {
  border-left: 3px solid var(--success);
}

.toast-success .toast-icon {
  color: var(--success);
}

.toast-error {
  border-left: 3px solid var(--danger);
}

.toast-error .toast-icon {
  color: var(--danger);
}

.toast-warning {
  border-left: 3px solid var(--warning);
}

.toast-warning .toast-icon {
  color: var(--warning);
}

.toast-info {
  border-left: 3px solid var(--info);
}

.toast-info .toast-icon {
  color: var(--info);
}

/* ── 로그인 페이지 ── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0a0e1a 0%, #111827 40%, #0d1525 100%);
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.08) 0%, transparent 70%);
  top: -200px;
  right: -100px;
  pointer-events: none;
}

.login-page::after {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.06) 0%, transparent 70%);
  bottom: -150px;
  left: -100px;
  pointer-events: none;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
  animation: float 6s ease-in-out infinite, fadeInUp 0.6s ease;
  position: relative;
  z-index: 1;
}

.login-logo {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.login-logo img {
  width: 64px;
  height: 64px;
  margin-bottom: var(--space-md);
}

.login-logo-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--primary), #6366f1);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: var(--font-2xl);
  color: white;
  margin: 0 auto var(--space-md);
  box-shadow: 0 8px 32px rgba(59, 130, 246, 0.3);
}

.login-title {
  font-size: var(--font-2xl);
  font-weight: 800;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: var(--font-sm);
  color: var(--text-muted);
  text-align: center;
  margin-bottom: var(--space-xl);
}

.login-error {
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-md);
  color: var(--danger);
  font-size: var(--font-sm);
  margin-bottom: var(--space-md);
  display: none;
  animation: fadeIn 0.2s ease;
}

.login-error.show {
  display: block;
}

.login-form .form-group {
  margin-bottom: var(--space-md);
}

.login-form .btn {
  width: 100%;
  padding: 12px;
  font-size: var(--font-md);
  margin-top: var(--space-sm);
}

/* ── 견적서 상세 (인쇄용) ── */
.quote-detail-view {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  max-width: 900px;
  margin: 0 auto;
}

.quote-header-section {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 2px solid var(--glass-border);
}

.quote-title-area h1 {
  font-size: var(--font-3xl);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 8px;
}

.quote-number {
  font-size: var(--font-md);
  color: var(--text-secondary);
  margin-top: var(--space-sm);
}

.quote-logo-area {
  text-align: right;
}

.quote-logo-area img {
  height: 50px;
}

.quote-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.quote-info-box {
  padding: var(--space-lg);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
}

.quote-info-box h3 {
  font-size: var(--font-md);
  font-weight: 700;
  color: var(--primary);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--glass-border);
}

.quote-info-row {
  display: flex;
  padding: 6px 0;
  font-size: var(--font-base);
}

.quote-info-label {
  width: 100px;
  color: var(--text-secondary);
  font-weight: 500;
  flex-shrink: 0;
}

.quote-info-value {
  color: var(--text-primary);
  font-weight: 500;
}

.quote-items-section {
  margin-bottom: var(--space-xl);
}

.quote-items-section h3 {
  font-size: var(--font-md);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.quote-totals {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-lg);
}

.quote-totals-box {
  min-width: 300px;
  padding: var(--space-lg);
  background: rgba(59, 130, 246, 0.05);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-md);
}

.quote-total-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: var(--font-base);
  color: var(--text-secondary);
}

.quote-total-row:last-child {
  border-top: 1px solid rgba(59, 130, 246, 0.2);
  padding-top: var(--space-md);
  margin-top: var(--space-sm);
  font-size: var(--font-lg);
  font-weight: 700;
  color: var(--text-primary);
}

.quote-notes-section {
  padding: var(--space-lg);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
}

.quote-notes-section h3 {
  font-size: var(--font-base);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.quote-notes-section p {
  color: var(--text-primary);
  font-size: var(--font-base);
  white-space: pre-wrap;
}

.quote-seal {
  text-align: right;
  margin-top: var(--space-lg);
}

.quote-seal img {
  width: 80px;
  height: 80px;
  opacity: 0.8;
}

/* 액션 버튼 바 */
.action-bar {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-bottom: var(--space-xl);
  padding: var(--space-md) var(--space-lg);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
}

.action-bar-divider {
  width: 1px;
  height: 28px;
  background: var(--glass-border);
}

.action-bar .btn {
  font-size: var(--font-sm);
}

/* 상태 변경 드롭다운 */
.status-dropdown {
  position: relative;
  display: inline-block;
}

.status-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  min-width: 160px;
  z-index: 50;
  display: none;
  animation: slideDown 0.15s ease;
}

.status-dropdown-menu.show {
  display: block;
}

.status-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 8px 14px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: var(--font-sm);
  border: none;
  background: none;
  width: 100%;
  font-family: var(--font-family);
}

.status-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

/* ── 이메일 이력 ── */
.email-history {
  margin-top: var(--space-xl);
}

.email-history h3 {
  font-size: var(--font-lg);
  font-weight: 700;
  margin-bottom: var(--space-md);
}

/* ── 견적서 폼 아이템 테이블 ── */
.items-table-wrap {
  overflow-x: auto;
  margin: var(--space-lg) 0;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
}

.items-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1000px;
}

.items-table thead th {
  background: rgba(255, 255, 255, 0.04);
  padding: 10px 8px;
  font-size: var(--font-xs);
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  border-bottom: 1px solid var(--glass-border);
  white-space: nowrap;
}

.items-table tbody td {
  padding: 6px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  vertical-align: middle;
}

.items-table tbody td input {
  width: 100%;
  padding: 8px 10px;
  font-size: var(--font-sm);
  font-family: var(--font-family);
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  outline: none;
  transition: all var(--transition-fast);
}

.items-table tbody td input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.items-table tbody td input[readonly] {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
}

.items-table .row-no {
  width: 40px;
  text-align: center;
  color: var(--text-muted);
  font-size: var(--font-sm);
  font-weight: 600;
}

.items-table .row-delete {
  width: 40px;
  text-align: center;
}

.items-table .row-delete button {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  color: var(--danger);
  cursor: pointer;
  font-size: 16px;
  transition: all var(--transition-fast);
  font-family: var(--font-family);
}

.items-table .row-delete button:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
}

.items-table tfoot td {
  padding: 12px 8px;
  background: rgba(59, 130, 246, 0.05);
  font-weight: 700;
  font-size: var(--font-base);
  color: var(--text-primary);
  border-top: 2px solid var(--glass-border);
}

.add-row-btn {
  margin-top: var(--space-md);
}

/* ── 서명 에디터 ── */
.signature-editor {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

.signature-textarea {
  min-height: 300px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: var(--font-sm);
  line-height: 1.7;
}

.signature-preview {
  min-height: 300px;
  padding: var(--space-lg);
  background: white;
  color: #333;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  overflow-y: auto;
  font-family: 'Malgun Gothic', sans-serif;
  font-size: 13px;
}

/* ── 설정 페이지 섹션 ── */
.settings-section {
  margin-bottom: var(--space-xl);
}

.settings-section .card {
  animation-delay: calc(var(--i, 0) * 0.1s);
}

/* ── 페이지 헤더 ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
}

.page-title {
  font-size: var(--font-2xl);
  font-weight: 800;
  color: var(--text-primary);
}

.page-subtitle {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ── 로딩 스피너 ── */
.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ── 빈 상태 ── */
.empty-state {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 64px;
  margin-bottom: var(--space-md);
  opacity: 0.3;
}

.empty-state-text {
  font-size: var(--font-md);
  margin-bottom: var(--space-lg);
}

/* ── 유틸리티 ── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.w-full { width: 100%; }
.font-bold { font-weight: 700; }
.text-sm { font-size: var(--font-sm); }
.text-muted { color: var(--text-muted); }

/* ── 반응형: 태블릿 (1024px 이하) ── */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .header {
    left: 0;
  }

  .header-menu-toggle {
    display: flex;
  }

  .main-content {
    margin-left: 0;
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: calc(var(--z-sidebar) - 1);
    display: none;
  }

  .sidebar-overlay.show {
    display: block;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .quote-info-grid {
    grid-template-columns: 1fr;
  }

  .signature-editor {
    grid-template-columns: 1fr;
  }
}

/* ── 반응형: 모바일 (768px 이하) ── */
@media (max-width: 768px) {
  .main-content {
    padding: var(--space-md);
  }

  .stat-cards {
    grid-template-columns: 1fr 1fr;
  }

  .search-bar {
    flex-direction: column;
  }

  .search-bar .form-group {
    min-width: 100%;
  }

  .action-bar {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .page-header {
    flex-direction: column;
    gap: var(--space-md);
    align-items: stretch;
  }

  .login-card {
    margin: var(--space-md);
    padding: var(--space-lg);
  }
}

/* ── 인쇄 스타일 ── */
@media print {
  body {
    background: white !important;
    color: #000 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .sidebar,
  .header,
  .action-bar,
  .email-history,
  .sidebar-overlay,
  #toast-container,
  #modal-container,
  .btn,
  .pagination,
  .search-bar {
    display: none !important;
  }

  .main-content {
    margin: 0 !important;
    padding: 0 !important;
  }

  .quote-detail-view {
    background: white !important;
    border: none !important;
    padding: 20px !important;
    box-shadow: none !important;
    max-width: 100% !important;
  }

  .quote-detail-view * {
    color: #000 !important;
    background: transparent !important;
    border-color: #ccc !important;
  }

  .quote-info-box {
    background: transparent !important;
    border: 1px solid #ccc !important;
  }

  .quote-info-box h3 {
    color: #333 !important;
  }

  .table thead th {
    background: #f3f4f6 !important;
    color: #000 !important;
  }

  .table tbody td {
    border-color: #ddd !important;
  }

  .quote-totals-box {
    background: #f8fafc !important;
    border-color: #ccc !important;
  }
}
