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

:root {
  --color-navy: #141923;
  --color-navy-light: #242b38;
  --color-blue: #2257a6;
  --color-blue-light: #3d76cf;
  --color-purple: #7047a8;
  --color-purple-light: #8a63c3;
  --color-mint: #168979;
  --color-green: #1d8f58;
  --color-orange: #b76b25;
  --color-red: #b33a3a;
  --color-yellow: #b9952f;
  --color-gray-50: #f7f8f6;
  --color-gray-100: #eceee9;
  --color-gray-200: #d9ddd5;
  --color-gray-300: #c3c9bf;
  --color-gray-400: #8f998b;
  --color-gray-500: #687466;
  --color-gray-600: #4d594d;
  --color-gray-700: #303a35;
  --color-gray-800: #202824;
  --color-white: #ffffff;
  --bg-base: #f7f8f6;
  --bg-surface: #ffffff;
  --bg-secondary: #f0f3ef;
  --bg-tertiary: #e5e9e2;
  --bg-elevated: #fbfcfa;
  --bg-overlay: rgba(20, 25, 35, 0.58);
  --border: #d9ddd5;
  --border-light: #eceee9;
  --border-accent: #2257a6;

  --accent-cobalt: #2257a6;
  --accent-teal: #168979;
  --accent-ruby: #b33a3a;
  --accent-gold: #b9952f;
  --accent-violet: #7047a8;

  --gradient-main: linear-gradient(135deg, #1c4f95 0%, #168979 100%);
  --gradient-sub: linear-gradient(135deg, #168979 0%, #b9952f 100%);
  --gradient-warm: linear-gradient(135deg, #b9952f 0%, #b33a3a 100%);
  --gradient-cool: linear-gradient(135deg, #2257a6 0%, #168979 100%);
  --gradient-hero: linear-gradient(135deg, #141923 0%, #26394a 48%, #2257a6 100%);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;

  --shadow-sm: 0 1px 3px rgba(20, 25, 35, 0.05);
  --shadow-md: 0 4px 12px rgba(20, 25, 35, 0.07);
  --shadow-lg: 0 10px 30px rgba(20, 25, 35, 0.10);
  --shadow-xl: 0 20px 50px rgba(20, 25, 35, 0.14);

  --sidebar-width: 280px;
  --topbar-height: 72px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-base);
  color: var(--color-navy);
  line-height: 1.6;
  font-size: 14px;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; border: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }

.app-shell {
  display: flex;
  min-height: 100vh;
}

/* Sidebar - White Premium */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-surface);
  color: var(--color-navy);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  box-shadow: 2px 0 12px rgba(20, 25, 35, 0.04);
}

.sidebar-logo {
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--border-light);
}

.sidebar-logo h1 {
  font-size: 20px;
  font-weight: 800;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.3px;
}

.sidebar-logo p {
  font-size: 11px;
  color: var(--color-gray-400);
  margin-top: 4px;
  letter-spacing: 0.3px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
}

.sidebar-nav .nav-group {
  margin-bottom: 12px;
}

.sidebar-nav .nav-group-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--accent-violet);
  padding: 10px 12px 4px;
  font-weight: 700;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--color-gray-600);
  font-size: 13px;
  font-weight: 400;
  transition: var(--transition);
}

.sidebar-nav a:hover {
  background: var(--bg-base);
  color: var(--color-navy);
}

.sidebar-nav a.active {
  background: var(--gradient-main);
  color: white;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(34, 87, 166, 0.24);
}

.sidebar-nav a .nav-icon {
  font-size: 11px;
  font-weight: 700;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--color-gray-100);
  color: var(--color-gray-500);
  transition: var(--transition);
}

.sidebar-nav a.active .nav-icon {
  background: rgba(255,255,255,0.2);
  color: white;
}

.sidebar-nav a:hover .nav-icon {
  background: var(--color-gray-200);
  color: var(--color-navy);
}

.sidebar-nav .nav-group.collapsible .nav-group-title {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}
.sidebar-nav .nav-group.collapsible .nav-group-title::after {
  content: '\25BC';
  font-size: 8px;
  transition: transform 0.2s;
}
.sidebar-nav .nav-group.collapsible.collapsed .nav-group-title::after {
  transform: rotate(-90deg);
}
.sidebar-nav .nav-group.collapsible .nav-group-links {
  max-height: 800px;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.sidebar-nav .nav-group.collapsible.collapsed .nav-group-links {
  max-height: 0;
}

/* Main Content */
.main {
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  min-height: 100vh;
  padding: 24px;
}

/* Topbar - White Premium */
.topbar {
  height: var(--topbar-height);
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  box-shadow: 0 2px 8px rgba(20, 25, 35, 0.05);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  margin-bottom: 24px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-left h2 {
  font-size: 18px;
  font-weight: 700;
}

.topbar-left .breadcrumb {
  font-size: 12px;
  color: var(--color-gray-500);
}

.topbar-search {
  position: relative;
  width: 320px;
}

.topbar-search input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 13px;
  background: var(--bg-base);
  transition: var(--transition);
}

.topbar-search input:focus {
  outline: none;
  border-color: var(--color-blue);
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px rgba(34, 87, 166, 0.12);
}

.topbar-search::before {
  content: '⌕';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-date {
  font-size: 12px;
  color: var(--color-gray-500);
}

/* Cards - White Premium */
.card {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  box-shadow: 0 2px 8px rgba(20, 25, 35, 0.05);
  border: 1px solid var(--border-light);
  padding: 24px;
  transition: var(--transition);
}

.card:hover {
  box-shadow: 0 8px 24px rgba(20, 25, 35, 0.09);
  border-color: var(--color-gray-200);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.card-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.card-header .card-badge {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 500;
}

/* Metric Cards */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.metric-card {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  box-shadow: 0 2px 8px rgba(20, 25, 35, 0.05);
  border: 1px solid var(--border-light);
  padding: 20px;
  text-align: center;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-main);
  opacity: 0.7;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.metric-card .metric-icon {
  font-size: 24px;
  margin-bottom: 8px;
}

.metric-card .metric-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--color-navy);
  line-height: 1.2;
}

.metric-card .metric-label {
  font-size: 12px;
  color: var(--color-gray-500);
  margin-top: 4px;
}

/* Grid Layouts */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
}

.btn-primary {
  background: var(--gradient-main);
  color: white;
  box-shadow: 0 4px 12px rgba(34, 87, 166, 0.24);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(34, 87, 166, 0.34);
}

.btn-secondary {
  background: var(--color-gray-100);
  color: var(--color-gray-700);
}

.btn-secondary:hover {
  background: var(--color-gray-200);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--color-gray-600);
}

.btn-outline:hover {
  border-color: var(--color-blue);
  color: var(--color-blue);
}

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

.btn-lg {
  padding: 14px 24px;
  font-size: 15px;
}

/* Tags & Badges */
.tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
}

.tag-blue { background: #e8eef8; color: #1c4f95; }
.tag-purple { background: #eee9f5; color: #5f3d8f; }
.tag-green { background: #e5f3ea; color: #176d44; }
.tag-orange { background: #f5eadb; color: #8b4f1c; }
.tag-red { background: #f6e4e2; color: #8f2f2f; }
.tag-mint { background: #dff1ed; color: #126c60; }
.tag-gray { background: #eceee9; color: #4d594d; }

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  background: var(--color-red);
  color: white;
}

/* Status */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
}

.status::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-active::before { background: var(--color-green); }
.status-warning::before { background: var(--color-orange); }
.status-danger::before { background: var(--color-red); }
.status-info::before { background: var(--color-blue); }

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-gray-700);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
  transition: var(--transition);
  background: var(--bg-surface);
}

.form-control:focus {
  outline: none;
  border-color: var(--color-blue);
  box-shadow: 0 0 0 3px rgba(34, 87, 166, 0.12);
}

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

select.form-control {
  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='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* Hero Section - White Premium */
.hero {
  background: var(--bg-surface);
  border-radius: var(--radius-2xl);
  padding: 40px 44px;
  color: var(--color-navy);
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-md);
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-main);
}

.hero::after {
  content: '';
  position: absolute;
  top: -60%;
  right: -15%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(22, 137, 121, 0.08), transparent);
  border-radius: 50%;
}

.hero h1 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 14px;
  color: var(--color-gray-500);
  position: relative;
  z-index: 1;
  line-height: 1.7;
}

/* Footer */
.site-footer {
  margin-top: 60px;
  padding: 32px 0 24px;
  border-top: 1px solid var(--border-light);
  text-align: center;
}

.site-footer-inner {
  max-width: 680px;
  margin: 0 auto;
}

.site-footer-logo {
  font-size: 16px;
  font-weight: 800;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.site-footer-desc {
  font-size: 12px;
  color: var(--color-gray-400);
  line-height: 1.7;
  margin-bottom: 16px;
}

.site-footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 16px;
}

.site-footer-links a {
  font-size: 12px;
  color: var(--color-gray-500);
  transition: var(--transition);
}

.site-footer-links a:hover {
  color: var(--color-blue);
}

.site-footer-copy {
  font-size: 11px;
  color: var(--color-gray-400);
}

.site-footer-copy span {
  margin: 0 6px;
  opacity: 0.4;
}

/* Score Gauge */
.score-gauge {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: conic-gradient(var(--color-blue) var(--score-deg, 0deg), var(--color-gray-200) 0deg);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.score-gauge::before {
  content: '';
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--bg-surface);
  position: absolute;
}

.score-gauge .score-value {
  position: relative;
  z-index: 1;
  font-size: 24px;
  font-weight: 800;
  color: var(--color-navy);
}

/* Kanban */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  min-height: 500px;
}

.kanban-column {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  padding: 16px;
  border: 1px solid var(--border-light);
}

.kanban-column-header {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kanban-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  cursor: grab;
  transition: var(--transition);
}

.kanban-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* Tables */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

table th, table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}

table th {
  font-weight: 600;
  color: var(--color-gray-500);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

table tr:hover td {
  background: var(--bg-base);
}

/* Chat UI */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 200px);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.chat-message {
  margin-bottom: 16px;
  display: flex;
  gap: 12px;
}

.chat-message.user {
  justify-content: flex-end;
}

.chat-message .msg-bubble {
  max-width: 70%;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  line-height: 1.6;
}

.chat-message.user .msg-bubble {
  background: var(--gradient-main);
  color: white;
  border-bottom-right-radius: 4px;
}

.chat-message.ai .msg-bubble {
  background: var(--color-gray-100);
  color: var(--color-navy);
  border-bottom-left-radius: 4px;
}

.chat-input {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}

.chat-input input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 13px;
}

.chat-input input:focus {
  outline: none;
  border-color: var(--color-blue);
}

/* Checklist */
.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}

.checklist-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--color-blue);
}

.checklist-item label {
  font-size: 13px;
  color: var(--color-gray-700);
}

/* Responsive */
@media (max-width: 1400px) {
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .main { margin-left: 0; width: 100%; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .kanban-board { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .kanban-board { grid-template-columns: 1fr; }
  .topbar-search { display: none; }
}

/* Utility */
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-gap-8 { display: flex; gap: 8px; }
.flex-gap-12 { display: flex; gap: 12px; }
.flex-wrap { flex-wrap: wrap; }
.text-sm { font-size: 12px; }
.text-muted { color: var(--color-gray-500); }
.text-bold { font-weight: 700; }
.text-center { text-align: center; }
.w-full { width: 100%; }
.hidden { display: none; }

/* Visual Hero - White Premium */
.visual-hero {
  min-height: 240px;
  background-position: center;
  background-size: cover;
  border-radius: var(--radius-2xl);
  padding: 44px;
  color: var(--color-navy);
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  background-color: var(--color-white);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-md);
}
.visual-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0.95), rgba(255,255,255,0.8), rgba(255,255,255,0.5));
}
.visual-hero::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--gradient-main);
}
.visual-hero-content {
  position: relative;
  z-index: 1;
  max-width: 780px;
}
.visual-hero h1 {
  font-size: 30px;
  font-weight: 800;
  margin-bottom: 10px;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.visual-hero p {
  font-size: 14px;
  color: var(--color-gray-600);
  max-width: 680px;
  line-height: 1.7;
}
.media-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}
.media-card {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  box-shadow: 0 2px 8px rgba(20, 25, 35, 0.05);
  overflow: hidden;
  transition: var(--transition);
  border: 1px solid var(--border-light);
}
.media-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.media-card img,
.source-thumb,
.case-thumb {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: var(--color-gray-100);
  display: block;
}
.media-card-body {
  padding: 14px;
}
.media-card-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 6px;
}
.media-card-meta {
  font-size: 11px;
  color: var(--color-gray-500);
}
.source-card.with-thumb {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
  padding: 0;
  overflow: hidden;
}
.source-card.with-thumb .source-card-content {
  padding: 22px 22px 22px 0;
}
.insight-strip {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
.insight-panel {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  box-shadow: 0 2px 8px rgba(20, 25, 35, 0.05);
  border: 1px solid var(--border-light);
  padding: 22px;
  border-top: 3px solid var(--color-blue);
}
.insight-panel h3 {
  font-size: 15px;
  margin-bottom: 8px;
}
.insight-panel p {
  font-size: 13px;
  color: var(--color-gray-600);
  line-height: 1.7;
}
.case-card.with-image {
  padding: 0;
  overflow: hidden;
}
.case-card.with-image .case-card-body {
  padding: 22px;
}
@media (max-width: 1400px) {
  .media-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .insight-strip { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .visual-hero { padding: 28px; min-height: 260px; }
  .visual-hero h1 { font-size: 26px; }
  .media-grid { grid-template-columns: 1fr; }
  .source-card.with-thumb { grid-template-columns: 1fr; }
  .source-card.with-thumb .source-card-content { padding: 18px; }
}
