/* ============================================================
   style.css — 영업일보 시스템 스타일
   테마: 산업용 프로페셔널 (딥 네이비 + 앰버 액센트)
   v1.0 2024-01
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-card: #1c2128;
  --bg-hover: #21262d;
  --border: #30363d;
  --border-light: #21262d;

  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #484f58;

  --accent: #f0a500;
  --accent-dim: rgba(240, 165, 0, 0.15);
  --accent-hover: #fbb72c;

  --blue: #58a6ff;
  --blue-dim: rgba(88, 166, 255, 0.1);
  --green: #3fb950;
  --green-dim: rgba(63, 185, 80, 0.1);
  --red: #f85149;
  --red-dim: rgba(248, 81, 73, 0.1);
  --orange: #d29922;
  --orange-dim: rgba(210, 153, 34, 0.1);

  --dealer-color: #58a6ff;
  --dealer-bg: rgba(88, 166, 255, 0.08);
  --eu-color: #3fb950;
  --eu-bg: rgba(63, 185, 80, 0.08);
  --internal-color: #8b949e;
  --internal-bg: rgba(139, 148, 158, 0.08);

  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.6);

  --font: 'Noto Sans KR', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

/* ── 로그인 화면 ─────────────────────────────────────────── */
#loginPage {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  background-image: radial-gradient(ellipse at 20% 50%, rgba(240,165,0,0.05) 0%, transparent 60%),
                    radial-gradient(ellipse at 80% 20%, rgba(88,166,255,0.05) 0%, transparent 50%);
}

.login-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.login-logo .logo-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
  font-family: var(--font-mono);
}

.login-logo .logo-accent {
  display: inline-block;
  width: 40px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  margin: 12px auto 16px;
}

.login-form .form-group { margin-bottom: 16px; }
.login-form label { display: block; font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.login-form input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font);
  transition: border-color 0.2s;
}
.login-form input:focus { outline: none; border-color: var(--accent); }
.btn-login {
  width: 100%;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--radius);
  padding: 13px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  font-family: var(--font);
  transition: background 0.2s, transform 0.1s;
}
.btn-login:hover { background: var(--accent-hover); }
.btn-login:active { transform: scale(0.99); }
.login-error { color: var(--red); font-size: 13px; text-align: center; margin-top: 12px; }

/* ── 앱 레이아웃 ─────────────────────────────────────────── */
#appLayout { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.3s;
}

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo h2 { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.sidebar-logo span { font-size: 11px; color: var(--accent); font-family: var(--font-mono); }

.sidebar-nav { flex: 1; padding: 12px 0; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 0;
  transition: all 0.15s;
  font-size: 13.5px;
  font-weight: 500;
  border-left: 3px solid transparent;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active { background: var(--accent-dim); color: var(--accent); border-left-color: var(--accent); }
.nav-item .nav-icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-user {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar {
  width: 32px; height: 32px;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--accent);
}
.user-info .user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.user-info .user-role { font-size: 11px; color: var(--text-muted); }
.btn-logout { margin-left: auto; background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 16px; }
.btn-logout:hover { color: var(--red); }

.main-content {
  flex: 1;
  margin-left: 220px;
  padding: 28px;
  max-width: calc(100vw - 220px);
}

/* ── 공통 컴포넌트 ────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.page-header h2 { font-size: 20px; font-weight: 700; }

.filter-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

input[type="text"], input[type="date"], input[type="time"], input[type="week"], select, textarea {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font);
  transition: border-color 0.2s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; min-height: 60px; }
select option { background: var(--bg-card); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 12px; color: var(--text-secondary); font-weight: 500; }
.form-group input, .form-group select, .form-group textarea { width: 100%; }
.form-group.full { grid-column: 1 / -1; }

.btn-primary {
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--radius);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.2s;
  white-space: nowrap;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-secondary:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-text { background: none; border: none; color: var(--blue); font-size: 13px; cursor: pointer; font-family: var(--font); }
.btn-text:hover { text-decoration: underline; }
.btn-lg { padding: 12px 24px; font-size: 15px; }

/* ── 배지 ──────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-dealer { background: var(--dealer-bg); color: var(--dealer-color); border: 1px solid rgba(88,166,255,0.3); }
.badge-eu { background: var(--eu-bg); color: var(--eu-color); border: 1px solid rgba(63,185,80,0.3); }
.badge-internal { background: var(--internal-bg); color: var(--internal-color); border: 1px solid rgba(139,148,158,0.2); }
.badge-industry { background: var(--orange-dim); color: var(--orange); border: 1px solid rgba(210,153,34,0.3); }
.badge-sm { font-size: 10px; padding: 2px 6px; }

/* ── 대시보드 ─────────────────────────────────────────────── */
.dashboard-container { max-width: 1200px; }

.dashboard-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 24px;
  background-image: radial-gradient(ellipse at 100% 50%, rgba(240,165,0,0.06) 0%, transparent 60%);
}
.hero-greeting h1 { font-size: 24px; font-weight: 700; }
.name-highlight { color: var(--accent); }
.hero-greeting p { color: var(--text-secondary); margin-top: 4px; }
.btn-write-report {
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--radius);
  padding: 13px 24px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-write-report:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(240,165,0,0.3); }

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  transition: border-color 0.2s;
}
.stat-card:hover { border-color: var(--accent); }
.stat-icon { font-size: 24px; margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 700; font-family: var(--font-mono); }
.stat-value.stat-alert { color: var(--red); }
.stat-value.stat-warn { color: var(--orange); }
.stat-label { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}
.dashboard-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.card-wide { grid-column: 1; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-header h3 { font-size: 14px; font-weight: 600; }

.todo-preview-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius);
  margin-bottom: 8px;
  border-left: 3px solid transparent;
}
.todo-normal { background: var(--bg-secondary); border-left-color: var(--green); }
.todo-warning { background: var(--orange-dim); border-left-color: var(--orange); }
.todo-urgent { background: var(--red-dim); border-left-color: var(--red); }
.todo-preview-info { flex: 1; }
.todo-company { font-weight: 600; font-size: 13px; margin-right: 8px; }
.todo-content { color: var(--text-secondary); font-size: 13px; }
.todo-preview-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); }
.btn-complete-todo {
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(63,185,80,0.3);
  border-radius: 4px;
  padding: 3px 10px;
  font-size: 12px;
  cursor: pointer;
  font-family: var(--font);
}

.cold-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
}
.cold-item:hover .cold-name { color: var(--blue); }
.cold-name { font-size: 13px; font-weight: 500; }
.cold-days { font-size: 12px; color: var(--red); font-family: var(--font-mono); }

.bar-item { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.bar-label { font-size: 12px; color: var(--text-secondary); width: 80px; flex-shrink: 0; }
.bar-track { flex: 1; background: var(--bg-secondary); border-radius: 3px; height: 6px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.5s; }
.bar-fill-industry { background: var(--blue); }
.bar-count { font-size: 12px; color: var(--text-muted); font-family: var(--font-mono); width: 40px; text-align: right; }

/* ── 일보 작성 ────────────────────────────────────────────── */
.report-write-container { max-width: 1100px; }

.report-header-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 24px;
  margin-bottom: 20px;
}
.report-meta { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.meta-label { font-size: 12px; color: var(--text-secondary); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.meta-value { font-size: 15px; font-weight: 600; margin-left: 8px; }
.meta-item { display: flex; align-items: center; gap: 8px; }
.meta-item input[type="date"] { font-size: 14px; }

.toggle-switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; inset: 0; background: var(--border); border-radius: 22px; transition: 0.3s; }
.toggle-slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: 0.3s; }
input:checked + .toggle-slider { background: var(--accent); }
input:checked + .toggle-slider:before { transform: translateX(18px); }

/* ── 미팅 블록 ────────────────────────────────────────────── */
.block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
  animation: slideIn 0.2s ease;
}
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

.block-dealer { border-top: 3px solid var(--dealer-color); }
.block-eu { border-top: 3px solid var(--eu-color); }
.block-internal { border-top: 3px solid var(--internal-color); }

.block-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.block-time { display: flex; align-items: center; gap: 6px; }
.block-time input[type="time"] { width: 100px; }
.block-time span { color: var(--text-muted); }

.customer-search-wrap { position: relative; flex: 1; min-width: 200px; }
.customer-search-wrap input { width: 100%; }

.btn-remove-block {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  margin-left: auto;
  padding: 4px 8px;
  border-radius: 4px;
}
.btn-remove-block:hover { background: var(--red-dim); color: var(--red); }

.block-body { padding: 20px; }

.dealer-grid, .eu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 16px; }
.dealer-left, .dealer-right, .eu-left, .eu-right { display: flex; flex-direction: column; gap: 12px; }

.product-tags, .special-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.tag-checkbox {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text-secondary);
}
.tag-checkbox:hover { border-color: var(--accent); color: var(--accent); }
.tag-checkbox input { cursor: pointer; accent-color: var(--accent); }
.tag-checkbox:has(input:checked) { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }

.block-add-buttons {
  display: flex;
  gap: 12px;
  margin: 20px 0;
  flex-wrap: wrap;
}
.btn-add-block {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.2s;
  border: 1px dashed;
}
.btn-dealer { background: var(--dealer-bg); color: var(--dealer-color); border-color: rgba(88,166,255,0.4); }
.btn-dealer:hover { background: rgba(88,166,255,0.15); }
.btn-eu { background: var(--eu-bg); color: var(--eu-color); border-color: rgba(63,185,80,0.4); }
.btn-eu:hover { background: rgba(63,185,80,0.15); }
.btn-internal { background: var(--internal-bg); color: var(--internal-color); border-color: rgba(139,148,158,0.3); }
.btn-internal:hover { background: rgba(139,148,158,0.15); }

.report-submit-bar {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

/* ── 드롭다운 ─────────────────────────────────────────────── */
.customer-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  z-index: 999;
  max-height: 240px;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  margin-top: 2px;
}
.dropdown-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.1s;
}
.dropdown-item:last-child { border-bottom: none; }
.dropdown-item:hover { background: var(--bg-hover); }
.dropdown-name { font-size: 13px; font-weight: 500; display: block; }
.dropdown-meta { font-size: 11px; color: var(--text-muted); }

/* ── @멘션 ──────────────────────────────────────────────────── */
.mention-field { margin-top: 8px; }
.mention-input-wrap { position: relative; }
.mention-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.mention-tag {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--blue-dim);
  color: var(--blue);
  border: 1px solid rgba(88,166,255,0.3);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
}
.mention-tag button { background: none; border: none; color: var(--blue); cursor: pointer; font-size: 12px; padding: 0; }

/* ── 일보 목록 ────────────────────────────────────────────── */
.report-list { display: flex; flex-direction: column; gap: 8px; }
.report-list-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  cursor: pointer;
  transition: all 0.15s;
}
.report-list-item:hover { border-color: var(--accent); background: var(--bg-hover); }
.report-list-date { text-align: center; min-width: 50px; }
.date-big { display: block; font-size: 18px; font-weight: 700; font-family: var(--font-mono); }
.date-year { font-size: 11px; color: var(--text-muted); }
.report-list-info { flex: 1; }
.report-list-author { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.report-list-summary { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--text-secondary); }
.status-done { color: var(--green); font-size: 13px; }
.status-pending { color: var(--orange); font-size: 13px; }

/* ── TO DO 페이지 ─────────────────────────────────────────── */
.todo-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 8px;
  border-left: 3px solid transparent;
}
.todo-normal { border-left-color: var(--green); }
.todo-warning { border-left-color: var(--orange); }
.todo-urgent { border-left-color: var(--red); background: var(--red-dim); }
.todo-done { opacity: 0.5; }
.todo-check input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; margin-top: 2px; }
.todo-body { flex: 1; }
.todo-company-name { font-weight: 600; font-size: 13px; margin-bottom: 3px; }
.todo-text { color: var(--text-secondary); font-size: 13px; }
.todo-meta { display: flex; gap: 12px; margin-top: 6px; font-size: 12px; color: var(--text-muted); flex-wrap: wrap; }
.days-badge { padding: 2px 8px; border-radius: 10px; font-family: var(--font-mono); }
.days-normal { background: var(--green-dim); color: var(--green); }
.days-warning { background: var(--orange-dim); color: var(--orange); }
.days-urgent { background: var(--red-dim); color: var(--red); }

/* ── 고객사 관리 ──────────────────────────────────────────── */
.search-bar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.search-bar input { flex: 1; min-width: 200px; }
.customer-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.customer-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: all 0.15s;
}
.customer-card:hover { border-color: var(--accent); }
.customer-card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.customer-name { font-weight: 600; font-size: 14px; flex: 1; }
.customer-card-info { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--text-secondary); }

/* ── 엑셀 스타일 출력 뷰 ──────────────────────────────────── */
.excel-report {
  background: #fff;
  color: #000;
  font-family: var(--font);
  font-size: 12px;
  border: 1px solid #aaa;
  width: 100%;
}
.excel-title-row {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 2px solid #000;
  background: #fff;
}
.excel-title { font-size: 18px; font-weight: 700; flex: 1; text-align: center; }
.excel-meta-right { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.excel-complete-circle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border: 2px solid #000; border-radius: 50%;
  font-weight: 700;
}
.excel-meta-row { display: flex; border-bottom: 1px solid #aaa; }
.excel-meta-item { display: flex; align-items: center; padding: 6px 12px; border-right: 1px solid #aaa; }
.excel-meta-item:last-child { border-right: none; }
.excel-label { font-weight: 600; margin-right: 8px; background: #e8f0d8; padding: 2px 6px; font-size: 11px; }
.excel-header-row {
  display: grid;
  grid-template-columns: 80px 100px 1fr;
  background: #e8f0d8;
  border-bottom: 1px solid #aaa;
  font-weight: 600;
}
.excel-col-time, .excel-col-company, .excel-col-content { padding: 6px 8px; border-right: 1px solid #aaa; font-size: 12px; text-align: center; }
.excel-col-content { text-align: left; border-right: none; }
.excel-row {
  display: grid;
  grid-template-columns: 80px 100px 1fr;
  border-bottom: 1px solid #ccc;
  min-height: 60px;
}
.excel-row-dealer { border-left: 3px solid #5b9bd5; }
.excel-row-eu { border-left: 3px solid #70ad47; }
.excel-row-internal { border-left: 3px solid #aaa; }
.excel-2col { display: grid; grid-template-columns: 1fr 1fr; }
.excel-2col > div { padding: 4px 8px; border-right: 1px solid #ddd; }
.excel-2col > div:last-child { border-right: none; }
.excel-field-label { font-weight: 600; font-size: 11px; color: #555; margin-bottom: 2px; }
.excel-field-content { font-size: 12px; margin-bottom: 4px; }
.excel-divider { border-top: 1px dashed #ccc; margin: 4px 0; }
.excel-products { padding: 4px 8px; background: #f5f5f5; font-size: 11px; color: #666; border-top: 1px solid #ddd; }

/* ── 모달 ─────────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal.hidden { display: none; }
.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-xl { max-width: 900px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 1;
}
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-header button { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 18px; padding: 4px; }
.modal-body { padding: 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 20px; border-top: 1px solid var(--border); }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.detail-item { background: var(--bg-secondary); border-radius: var(--radius); padding: 10px 12px; }
.detail-item.full { grid-column: 1 / -1; }
.detail-item .label { font-size: 11px; color: var(--text-muted); display: block; margin-bottom: 3px; }

/* ── 로딩 ─────────────────────────────────────────────────── */
#loadingOverlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
}
#loadingOverlay.hidden { display: none; }
.loading-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 토스트 ────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 20px;
  font-size: 14px;
  z-index: 9998;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s;
  box-shadow: var(--shadow-lg);
  max-width: 360px;
}
.toast-show { transform: translateY(0); opacity: 1; }
.toast-success { border-left: 3px solid var(--green); }
.toast-error { border-left: 3px solid var(--red); }
.toast-info { border-left: 3px solid var(--blue); }

/* ── 유틸 ─────────────────────────────────────────────────── */
.hidden { display: none !important; }
.empty-state { text-align: center; color: var(--text-muted); padding: 48px 20px; font-size: 14px; }
.empty-state-sm { color: var(--text-muted); font-size: 13px; text-align: center; padding: 16px; }
.mt-2 { margin-top: 12px; }

/* ── 출력 스타일 ──────────────────────────────────────────── */
@media print {
  .sidebar, .modal-header button, .modal-header .btn-secondary { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .modal { position: static; background: none; padding: 0; }
  .modal-content { border: none; max-height: none; box-shadow: none; max-width: none; }
  .print-area { display: block; }
  .excel-report { border: none; }
  body { background: white; color: black; }
}

/* ── 반응형 ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .main-content { margin-left: 0; padding: 16px; }
  .dashboard-stats { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dealer-grid, .eu-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .excel-row, .excel-header-row { grid-template-columns: 60px 80px 1fr; font-size: 10px; }
}
