/* =========================================================
   도핑 뉴스 모니터링 시스템 - 메인 스타일시트
   ========================================================= */

/* ---- 변수 정의 ---- */
:root {
  --primary: #1e40af;
  --primary-light: #3b82f6;
  --primary-dark: #1e3a8a;
  --accent: #f59e0b;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --bg: #f1f5f9;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --text-main: #0f172a;
  --text-sub: #64748b;
  --text-muted: #94a3b8;
  --header-height: 70px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,.10);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.12);
  --radius: 10px;
  --radius-sm: 6px;
}

/* ---- 리셋 & 기본 ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* =========================================================
   HEADER
   ========================================================= */
.main-header {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 50%, #2563eb 100%);
  color: white;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-icon {
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.15);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.header-logo h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  white-space: nowrap;
}

.header-sub {
  font-size: 11px;
  opacity: 0.75;
  margin-top: 1px;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  opacity: 0.9;
}

.meta-item i { font-size: 11px; opacity: 0.8; }
.meta-item strong { font-weight: 600; }

.status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  white-space: nowrap;
}

.status-badge i {
  font-size: 7px;
  color: #94a3b8;
  animation: none;
}

.status-badge.active i {
  color: #4ade80;
  animation: pulse-dot 1.5s ease-in-out infinite;
}

.status-badge.active {
  background: rgba(74, 222, 128, 0.15);
  border-color: rgba(74, 222, 128, 0.4);
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* =========================================================
   CONTROL PANEL
   ========================================================= */
.control-panel {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
  box-shadow: var(--shadow-sm);
}

.control-panel .container {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
}

.control-block {
  flex: 1;
  min-width: 220px;
}

.control-block h3 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 키워드 헤더 (타이틀 + 버튼 그룹) */
.kw-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 6px;
}

.kw-header h3 { margin-bottom: 0; }

.kw-header-actions {
  display: flex;
  gap: 5px;
}

/* ───────────────────────────────────────────────
   전체선택 / 전체해제 / 기본값복원 버튼
   투명 배경 + 검정 외곽선 + 컬러 SVG 인포그래픽
─────────────────────────────────────────────── */
.kw-ctrl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1.8px solid #111827;   /* 검정 실선 외곽 */
  border-radius: 9px;             /* 동그란 네모 */
  background: transparent;        /* 내부 투명 */
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.18s, box-shadow 0.18s, transform 0.15s, border-color 0.18s;
  position: relative;
  overflow: visible;
}

.kw-ctrl-btn svg {
  width: 20px;
  height: 20px;
  display: block;
  pointer-events: none;
}

/* ── 전체 선택: 초록 계열 hover ── */
.kw-ctrl-select:hover {
  background: rgba(22, 163, 74, 0.08);
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
  transform: scale(1.1);
}

/* ── 전체 해제: 오렌지 계열 hover ── */
.kw-ctrl-deselect:hover {
  background: rgba(234, 88, 12, 0.08);
  border-color: #ea580c;
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.15);
  transform: scale(1.1);
}

/* ── 기본값 복원: 파랑 계열 hover ── */
.kw-ctrl-reset:hover {
  background: rgba(29, 78, 216, 0.08);
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
  transform: scale(1.1);
}

/* active(클릭) 피드백 */
.kw-ctrl-btn:active { transform: scale(0.94); }

/* 툴팁 라벨 (hover 시 하단 표시) */
.kw-ctrl-btn::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: #1e293b;
  color: #f8fafc;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 5px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s;
  z-index: 10;
  font-family: 'Noto Sans KR', sans-serif;
}

.kw-ctrl-btn:hover::after { opacity: 1; }

/* 칩 내부 - 체크박스 숨김 유지, 텍스트 스타일 */
.kw-chip-item {
  border: none !important;
  background: transparent !important;
  padding: 4px 8px !important;
  font-size: 12px;
  cursor: pointer;
}
/* kw-edit-btn / kw-del-btn 스타일은 index.html <style> 블록에서 관리 */

/* 키워드 추가 버튼 칩 */
.kw-add-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  border: 1.5px dashed #93c5fd;
  border-radius: 20px;
  background: transparent;
  color: var(--primary-light);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}
.kw-add-chip:hover {
  border-color: var(--primary);
  background: #eff6ff;
  color: var(--primary);
  border-style: solid;
}

/* 키워드 칩 */
.keyword-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.chip-label { cursor: pointer; }
.chip-label input[type="checkbox"] { display: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-sub);
  background: #f8fafc;
  transition: all 0.2s;
  user-select: none;
  white-space: nowrap;
}

.chip-label input:checked + .chip {
  border-color: var(--primary-light);
  background: #eff6ff;
  color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.chip:hover { border-color: var(--primary-light); }

/* 옵션 행 */
.options-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.option-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 130px;
}

.option-item label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

select, input[type="text"] {
  padding: 7px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  color: var(--text-main);
  background: #f8fafc;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}

select:focus, input[type="text"]:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
  background: white;
}

/* 버튼 그룹 */
.control-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
  min-width: auto;
  flex: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}

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

.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(30,64,175,0.3);
}

.btn-secondary {
  background: #f0f4ff;
  color: var(--primary);
  border-color: #c7d7ff;
}
.btn-secondary:hover:not(:disabled) {
  background: #e0ecff;
  border-color: var(--primary-light);
}

.btn-outline {
  background: white;
  color: var(--text-sub);
  border-color: var(--border);
}
.btn-outline:hover { border-color: var(--primary-light); color: var(--primary); }

.btn-danger-outline {
  background: white;
  color: var(--danger);
  border-color: #fecaca;
}
.btn-danger-outline:hover { background: #fef2f2; border-color: var(--danger); }

/* 읽기전용 뷰어 버튼 */
.btn-viewer {
  background: white;
  color: #0f766e;
  border-color: #99f6e4;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-viewer:hover { background: #f0fdf9; border-color: #0f766e; color: #0f766e; }

/* =========================================================
   STATS BAR
   ========================================================= */
.stats-bar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}

.stats-bar .container {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
  overflow-x: auto;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 20px;
  flex-shrink: 0;
}

.stat-item i {
  font-size: 18px;
  color: var(--primary-light);
  opacity: 0.8;
}

.stat-item div {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.stat-item strong {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
}

.stat-item span {
  font-size: 11px;
  color: var(--text-muted);
}

.stat-divider {
  width: 1px;
  height: 32px;
  background: var(--border);
  flex-shrink: 0;
}

.kw-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* =========================================================
   PROGRESS BAR
   ========================================================= */
.progress-wrap {
  background: #eff6ff;
  border-bottom: 2px solid var(--primary-light);
  padding: 10px 0;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 6px;
}

.progress-bar-bg {
  height: 6px;
  background: #dbeafe;
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 10px;
  transition: width 0.4s ease;
  width: 0%;
}

/* =========================================================
   LOG PANEL
   ========================================================= */
.log-panel {
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
  max-height: 200px;
}

.log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 20px;
  background: #1e293b;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
}

.log-close {
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
}
.log-close:hover { color: white; background: #334155; }

.log-content {
  padding: 8px 20px;
  max-height: 150px;
  overflow-y: auto;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.8;
}

.log-line { padding: 1px 0; }
.log-default { color: #94a3b8; }
.log-success { color: #4ade80; }
.log-error { color: #f87171; }
.log-warn { color: #fbbf24; }
.log-info { color: #60a5fa; }

/* =========================================================
   MAIN TABLE
   ========================================================= */
.main-content {
  padding: 24px 0 40px;
}

.table-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.table-info {
  font-size: 13px;
  color: var(--text-sub);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sep { color: var(--border); }

#filtered-label {
  font-size: 12px;
  color: var(--primary-light);
  background: #eff6ff;
  padding: 2px 8px;
  border-radius: 10px;
}

.table-search {
  flex: 1;
  max-width: 380px;
  position: relative;
  margin-left: auto;
}

.table-search i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 13px;
}

.table-search input {
  padding-left: 36px;
  width: 100%;
  background: white;
}

.btn-icon {
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  color: var(--text-sub);
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.btn-icon:hover { border-color: var(--primary-light); color: var(--primary); }

/* 테이블 래퍼 */
.table-wrapper {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

thead tr {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 2px solid var(--border);
}

th {
  padding: 12px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

th.sortable {
  cursor: pointer;
  user-select: none;
  transition: color 0.2s;
}

th.sortable:hover { color: var(--primary); }
th.sortable i { margin-left: 4px; opacity: 0.6; }

.th-no { width: 52px; text-align: center; }
.th-keyword { width: 130px; }
.th-portal { width: 70px; text-align: center; }
.th-title { }
.th-source { width: 130px; }
.th-date { width: 140px; }
.th-link { width: 52px; text-align: center; }

/* 포털 컬럼 */
.td-portal { text-align: center; white-space: nowrap; }

/* 테이블 행 */
tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s;
}

tbody tr:hover { background: #f8fafc; }
tbody tr:last-child { border-bottom: none; }

.today-row { background: #fffbeb !important; }
.today-row:hover { background: #fef9c3 !important; }

td {
  padding: 11px 14px;
  vertical-align: middle;
  font-size: 13px;
}

.td-no {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}

/* 키워드 뱃지 */
.kw-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  border: 1.5px solid;
  white-space: nowrap;
}

.kw-dot-inline {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* 기사 링크 */
.article-link {
  color: var(--text-main);
  font-weight: 500;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 6px;
  word-break: break-word;
}

.article-link:hover { color: var(--primary); }

.new-badge {
  display: inline-block;
  padding: 1px 6px;
  background: #ef4444;
  color: white;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  animation: blink 2s ease-in-out infinite;
}

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

.source-name {
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 500;
}

.td-date {
  font-size: 12px;
  color: var(--text-sub);
  white-space: nowrap;
}

.today-date {
  color: #d97706 !important;
  font-weight: 600;
}

.link-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #f1f5f9;
  color: var(--primary-light);
  margin: 0 auto;
  transition: all 0.2s;
  font-size: 12px;
}

.link-btn:hover {
  background: var(--primary);
  color: white;
  transform: scale(1.1);
}

/* 빈 상태 */
.empty-box {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
}

.empty-box i {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
  display: block;
}

.empty-box p { font-size: 15px; font-weight: 500; margin-bottom: 6px; }
.empty-box .sub { font-size: 13px; opacity: 0.7; }

/* =========================================================
   PAGINATION
   ========================================================= */
.pagination-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  padding: 20px 0 0;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  color: var(--text-sub);
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--primary-light);
  color: var(--primary);
}

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

.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.page-ellipsis {
  color: var(--text-muted);
  padding: 0 4px;
}

.page-info {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 8px;
}

/* =========================================================
   키워드 관리 모달
   ========================================================= */
.kw-modal-box { max-width: 460px; }

.kw-form-group {
  margin-bottom: 18px;
}

.kw-form-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 8px;
}

.kw-input-wrap {
  position: relative;
}

.kw-text-input {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #f8fafc;
}

.kw-text-input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
  background: white;
}

.kw-input-hint {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--text-muted);
  pointer-events: none;
}

.kw-input-error {
  margin-top: 5px;
  font-size: 12px;
  color: var(--danger);
  min-height: 16px;
  font-weight: 500;
}

/* 색상 팔레트 */
.kw-color-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.color-palette-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  flex: 1;
}

.palette-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  border: 2.5px solid transparent;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.palette-dot:hover {
  transform: scale(1.2);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.palette-dot.selected {
  border-color: white;
  box-shadow: 0 0 0 2.5px var(--text-main), 0 2px 8px rgba(0,0,0,0.2);
  transform: scale(1.15);
}

.kw-color-preview-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.kw-color-preview {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 2px solid rgba(0,0,0,0.1);
  transition: background 0.2s;
}

/* 미리보기 영역 */
.kw-preview-area {
  padding: 12px 16px;
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
}

/* =========================================================
   MODAL
   ========================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  backdrop-filter: blur(2px);
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 201;
  width: 460px;
  max-width: calc(100vw - 32px);
}

.modal-box {
  background: white;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-header {
  padding: 18px 20px;
  background: linear-gradient(135deg, #1e40af, #3b82f6);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover { background: rgba(255,255,255,0.25); }

.modal-body { padding: 20px; }

.schedule-info { display: flex; flex-direction: column; gap: 10px; }

.info-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.5;
}

.info-row i { font-size: 14px; margin-top: 1px; flex-shrink: 0; }
.info-row strong { color: var(--text-main); }
.text-green { color: var(--success); }
.text-blue { color: var(--primary-light); }

.schedule-time-box {
  margin-top: 16px;
  padding: 14px 16px;
  background: #eff6ff;
  border-radius: var(--radius-sm);
  border: 1px solid #bfdbfe;
}

.next-schedule {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--primary);
}

.next-schedule i { font-size: 18px; }
.next-schedule strong { font-size: 15px; }

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* =========================================================
   TOAST
   ========================================================= */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 300;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Noto Sans KR', sans-serif;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s ease;
  max-width: 340px;
  line-height: 1.4;
}

.toast.show { transform: translateY(0); opacity: 1; }

.toast-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.toast-info    { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.toast-warn    { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.toast-error   { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

/* =========================================================
   FOOTER
   ========================================================= */
.main-footer {
  background: #1e293b;
  color: #64748b;
  padding: 16px 0;
  border-top: 1px solid #334155;
}

.main-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-left, .footer-right {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.footer-left i { color: #3b82f6; }
.footer-left span, .footer-right span { color: #64748b; }
.sep { color: #334155; }

/* =========================================================
   UTILITY
   ========================================================= */
.hidden { display: none !important; }

/* =========================================================
   PWA 설치 배너
   ========================================================= */
.pwa-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 150;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  color: white;
  padding: 14px 20px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.25);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-top: 2px solid rgba(59,130,246,0.4);
}

.pwa-banner.visible {
  transform: translateY(0);
}

.pwa-banner-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.pwa-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.pwa-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pwa-text strong {
  font-size: 14px;
  font-weight: 700;
}

.pwa-text span {
  font-size: 12px;
  opacity: 0.7;
}

.pwa-install-btn {
  flex-shrink: 0;
  background: #3b82f6 !important;
  border-color: #3b82f6 !important;
  padding: 8px 18px !important;
  font-size: 13px !important;
}

.pwa-install-btn:hover {
  background: #2563eb !important;
  border-color: #2563eb !important;
}

.pwa-banner-close {
  background: rgba(255,255,255,0.1);
  border: none;
  color: rgba(255,255,255,0.6);
  width: 30px;
  height: 30px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}
.pwa-banner-close:hover { background: rgba(255,255,255,0.2); color: white; }

/* 풋터 PWA 버튼 */
.footer-pwa-btn {
  background: rgba(59,130,246,0.15);
  border: 1px solid rgba(59,130,246,0.3);
  color: #60a5fa;
  padding: 4px 12px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
}
.footer-pwa-btn:hover {
  background: rgba(59,130,246,0.25);
  color: #93c5fd;
}

/* 앱 모드 뱃지 */
.app-mode-badge {
  background: rgba(74, 222, 128, 0.12) !important;
  border-color: rgba(74, 222, 128, 0.3) !important;
}
.app-mode-badge i { color: #4ade80 !important; animation: none !important; }

/* =========================================================
   설치 안내 모달 (PWA)
   ========================================================= */
.install-guide-box {
  max-width: 500px;
}

.install-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
}

.itab {
  flex: 1;
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  color: var(--text-sub);
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}

.itab.active {
  background: #eff6ff;
  border-color: var(--primary-light);
  color: var(--primary);
}

.itab:hover:not(.active) { border-color: var(--primary-light); }

.install-steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 16px;
}

.step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.step-num {
  width: 26px;
  height: 26px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}

.step strong {
  display: block;
  font-size: 13px;
  color: var(--text-main);
  margin-bottom: 3px;
}

.step p {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.5;
}

.kbd {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
  font-family: monospace;
  color: var(--text-main);
}

.install-tip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: #92400e;
  line-height: 1.5;
}

.install-tip i { color: #d97706; flex-shrink: 0; margin-top: 1px; }

.install-preview {
  margin-top: 16px;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.preview-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.preview-box div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.preview-box strong { font-size: 13px; color: var(--text-main); }
.preview-box small  { font-size: 11px; color: var(--text-muted); }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1024px) {
  .header-meta { display: none; }
  .control-panel .container { flex-direction: column; }
  .control-block { min-width: 100%; }
  .control-actions { flex: none; width: 100%; }
}

@media (max-width: 768px) {
  .header-logo h1 { font-size: 15px; }
  .header-sub { display: none; }
  .stats-bar .container { gap: 0; overflow-x: auto; flex-wrap: nowrap; }
  .stat-item { padding: 4px 12px; }
  .stat-item strong { font-size: 16px; }
  .table-toolbar { flex-wrap: wrap; }
  .table-search { max-width: 100%; order: 3; flex: 1 1 100%; }
  .toast { right: 16px; bottom: 16px; left: 16px; max-width: none; }
}

@media (max-width: 480px) {
  .options-row { flex-direction: column; }
  .option-item { min-width: 100%; }
  .keyword-chips { gap: 6px; }
  .chip { font-size: 11px; padding: 4px 10px; }
  .btn { font-size: 12px; padding: 7px 12px; }
}

/* =========================================================
   SCROLLBAR
   ========================================================= */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* =========================================================
   PROXY SETTINGS BLOCK
   ========================================================= */
#proxy-settings-block {
  min-width: 100%;
  border-top: 1px dashed #e2e8f0;
  padding-top: 14px;
  margin-top: 2px;
}

.proxy-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 9px;
  border-radius: 12px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 10px;
  font-weight: 600;
  font-family: inherit;
  vertical-align: middle;
  text-transform: none;
  letter-spacing: 0;
}
.proxy-badge.active {
  background: #dcfce7;
  color: #166534;
}
.proxy-badge.warn {
  background: #fef9c3;
  color: #92400e;
  border: 1px solid #fde68a;
}
.proxy-badge.error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.proxy-setting-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.proxy-input-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.proxy-input-row input[type="url"] {
  flex: 1;
  padding: 7px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--text-main);
  background: #f8fafc;
  transition: border-color .15s;
  min-width: 0;
}
.proxy-input-row input[type="url"]:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
}
.btn-proxy-save {
  padding: 7px 14px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: background .15s;
}
.btn-proxy-save:hover { background: #1e3a8a; }
.btn-proxy-clear {
  padding: 7px 10px;
  background: transparent;
  color: #94a3b8;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}
.btn-proxy-clear:hover { border-color: #dc2626; color: #dc2626; }

.proxy-desc {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.6;
}
.proxy-guide-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}
.proxy-guide-link:hover { text-decoration: underline; }
