/* shadcn/ui inspired CSS - Dark/Light theme */
:root {
  --background: 0 0% 100%;
  --foreground: 240 10% 3.9%;
  --card: 0 0% 100%;
  --card-foreground: 240 10% 3.9%;
  --popover: 0 0% 100%;
  --popover-foreground: 240 10% 3.9%;
  --primary: 240 5.9% 10%;
  --primary-foreground: 0 0% 98%;
  --secondary: 240 4.8% 95.9%;
  --secondary-foreground: 240 5.9% 10%;
  --muted: 240 4.8% 95.9%;
  --muted-foreground: 240 3.8% 46.1%;
  --accent: 240 4.8% 95.9%;
  --accent-foreground: 240 5.9% 10%;
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 0 0% 98%;
  --border: 240 5.9% 90%;
  --input: 240 5.9% 90%;
  --ring: 240 5.9% 10%;
  --radius: 0.5rem;
  --success: 142 76% 36%;
  --warning: 38 92% 50%;
  --info: 217 91% 60%;
  --sidebar-width: 260px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", sans-serif;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  line-height: 1.6;
  font-size: 14px;
}

a { color: hsl(var(--primary)); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  background: hsl(var(--card));
  border-right: 1px solid hsl(var(--border));
  padding: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 50;
}

.sidebar-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid hsl(var(--border));
}

.sidebar-header h1 {
  font-size: 16px;
  font-weight: 700;
  color: hsl(var(--foreground));
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-header h1 svg { width: 20px; height: 20px; }

.sidebar-nav { padding: 12px 8px; }

.nav-section { margin-bottom: 16px; }
.nav-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: hsl(var(--muted-foreground));
  padding: 4px 12px;
  margin-bottom: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius);
  color: hsl(var(--muted-foreground));
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}

.nav-item:hover {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
  text-decoration: none;
}

.nav-item.active {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 600;
}
.nav-item.active .nav-badge {
  background: hsl(var(--primary-foreground) / 0.2);
  color: hsl(var(--primary-foreground));
}

.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
}

.page-header {
  padding: 24px 32px 16px;
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--card));
}

.page-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: hsl(var(--foreground));
}

.page-header p {
  color: hsl(var(--muted-foreground));
  font-size: 13px;
  margin-top: 2px;
}

.page-body { padding: 24px 32px; }

/* Cards */
.card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  overflow: hidden;
}

.card-header { padding: 16px 20px 12px; }
.card-title { font-size: 15px; font-weight: 600; }
.card-description { font-size: 12px; color: hsl(var(--muted-foreground)); margin-top: 2px; }
.card-content { padding: 0 20px 16px; }
.card-footer {
  padding: 12px 20px;
  border-top: 1px solid hsl(var(--border));
  background: hsl(var(--muted) / 0.3);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  padding: 20px;
}

.stat-card .stat-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  font-size: 18px;
}

.stat-card .stat-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-card .stat-label {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  font-weight: 500;
}

.stat-icon.blue { background: hsl(217 91% 60% / 0.1); color: hsl(217 91% 60%); }
.stat-icon.green { background: hsl(142 76% 36% / 0.1); color: hsl(142 76% 36%); }
.stat-icon.orange { background: hsl(38 92% 50% / 0.1); color: hsl(38 92% 50%); }
.stat-icon.red { background: hsl(0 84% 60% / 0.1); color: hsl(0 84% 60%); }
.stat-icon.purple { background: hsl(262 83% 58% / 0.1); color: hsl(262 83% 58%); }

/* Table */
.table-wrapper { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  text-align: left;
  padding: 10px 12px;
  font-weight: 600;
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--muted) / 0.3);
  white-space: nowrap;
}

tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid hsl(var(--border));
  vertical-align: middle;
}

tbody tr:hover { background: hsl(var(--muted) / 0.4); }
tbody tr:last-child td { border-bottom: none; }

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-active { background: hsl(142 76% 36% / 0.1); color: hsl(142 76% 36%); }
.badge-closed { background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }
.badge-unread { background: hsl(0 84% 60% / 0.1); color: hsl(0 84% 60%); }
.badge-pass { background: hsl(217 91% 60% / 0.1); color: hsl(217 91% 60%); }
.badge-final { background: hsl(262 83% 58% / 0.1); color: hsl(262 83% 58%); }
.badge-pending { background: hsl(38 92% 50% / 0.1); color: hsl(38 92% 50%); }
.badge-running { background: hsl(217 91% 60% / 0.1); color: hsl(217 91% 60%); animation: pulse 2s infinite; }
.badge-completed { background: hsl(142 76% 36% / 0.1); color: hsl(142 76% 36%); }
.badge-failed { background: hsl(0 84% 60% / 0.1); color: hsl(0 84% 60%); }

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn:hover { text-decoration: none; }

.btn-primary {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.btn-primary:hover { opacity: 0.9; }

.btn-secondary {
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  border-color: hsl(var(--border));
}
.btn-secondary:hover { background: hsl(var(--accent)); }

.btn-destructive {
  background: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
}

.btn-outline {
  background: transparent;
  color: hsl(var(--foreground));
  border-color: hsl(var(--border));
}
.btn-outline:hover { background: hsl(var(--accent)); }

.btn-ghost { background: transparent; color: hsl(var(--foreground)); }
.btn-ghost:hover { background: hsl(var(--accent)); }

.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-lg { padding: 10px 20px; font-size: 15px; }
.btn-icon { padding: 8px; }

.btn[disabled], .btn.loading {
  opacity: 0.5;
  pointer-events: none;
}

/* Input/Select */
.input, .select {
  padding: 8px 12px;
  border: 1px solid hsl(var(--input));
  border-radius: var(--radius);
  font-size: 13px;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  outline: none;
  transition: border-color 0.15s;
}

.input:focus, .select:focus {
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.1);
}

/* Tabs */
.tabs { display: flex; gap: 0; border-bottom: 1px solid hsl(var(--border)); margin-bottom: 20px; }

.tab-item {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  cursor: pointer;
}

.tab-item:hover { color: hsl(var(--foreground)); text-decoration: none; }
.tab-item.active {
  color: hsl(var(--foreground));
  border-bottom-color: hsl(var(--primary));
}

/* Avatar */
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: hsl(var(--muted));
  flex-shrink: 0;
}

.avatar-lg { width: 80px; height: 80px; }

/* Flex/Grid helpers */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mr-2 { margin-right: 8px; }
.p-4 { padding: 16px; }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-muted { color: hsl(var(--muted-foreground)); }
.text-right { text-align: right; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-full { width: 100%; }

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

/* Profile */
.profile-header {
  display: flex;
  gap: 24px;
  padding: 24px;
}

.profile-info h3 { font-size: 20px; font-weight: 700; }
.profile-info .meta { color: hsl(var(--muted-foreground)); font-size: 13px; margin-top: 4px; }

.info-grid {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 8px 16px;
  font-size: 13px;
}

.info-grid dt { color: hsl(var(--muted-foreground)); font-weight: 500; }
.info-grid dd { color: hsl(var(--foreground)); }

/* Resume */
.resume-frame {
  width: 100%;
  min-height: 600px;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: white;
  padding: 24px;
}

/* Filter bar */
.filter-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: hsl(var(--muted-foreground));
}

.empty-state svg { width: 48px; height: 48px; margin-bottom: 12px; opacity: 0.3; }
.empty-state p { font-size: 14px; }

/* Responsive */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .main-content { margin-left: 0; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .page-body { padding: 16px; }
}
