* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #0f1117; color: #e1e4e8; line-height: 1.5; }
.container { max-width: 1400px; margin: 0 auto; padding: 20px; }
header { margin-bottom: 24px; }
h1 { font-size: 28px; font-weight: 700; }
h2 { font-size: 20px; margin-bottom: 16px; }
h3 { font-size: 16px; margin-bottom: 12px; color: #8b949e; }
.subtitle { color: #8b949e; font-size: 14px; }
.back-link { color: #58a6ff; text-decoration: none; font-size: 14px; display: inline-block; margin-bottom: 8px; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat-card { background: #161b22; border: 1px solid #30363d; border-radius: 8px; padding: 16px; text-align: center; }
.stat-value { font-size: 28px; font-weight: 700; }
.stat-label { font-size: 12px; color: #8b949e; text-transform: uppercase; letter-spacing: 0.5px; }
.accent-green .stat-value { color: #3fb950; }
.accent-blue .stat-value { color: #58a6ff; }
.accent-gray .stat-value { color: #8b949e; }
.accent-purple .stat-value { color: #bc8cff; }
.accent-orange .stat-value { color: #d29922; }

/* Controls */
.controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 20px; }
.search-form { display: flex; gap: 8px; }
.search-input { background: #161b22; border: 1px solid #30363d; border-radius: 6px; padding: 8px 12px; color: #e1e4e8; font-size: 14px; width: 240px; }
.filters, .sorts { display: flex; gap: 4px; align-items: center; font-size: 13px; color: #8b949e; }
.btn { background: #21262d; border: 1px solid #30363d; border-radius: 6px; padding: 6px 12px; color: #c9d1d9; font-size: 13px; cursor: pointer; text-decoration: none; display: inline-block; }
.btn:hover { background: #30363d; }
.btn.active { background: #1f6feb; border-color: #1f6feb; color: #fff; }
.btn-sm { padding: 4px 8px; font-size: 12px; }
.btn-primary { background: #238636; border-color: #238636; color: #fff; font-size: 14px; padding: 10px 24px; }
.btn-primary:hover { background: #2ea043; }

/* Table */
.table-wrap { overflow-x: auto; margin-bottom: 24px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th { background: #161b22; padding: 10px 12px; text-align: left; font-weight: 600; color: #8b949e; border-bottom: 1px solid #30363d; position: sticky; top: 0; white-space: nowrap; }
tbody td { padding: 8px 12px; border-bottom: 1px solid #21262d; vertical-align: middle; }
tbody tr:hover { background: #161b22; }
.project-link { color: #58a6ff; text-decoration: none; font-weight: 600; }
.project-link:hover { text-decoration: underline; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.date { color: #8b949e; white-space: nowrap; }
.tech-cell { max-width: 300px; }

/* Sortable headers */
.num-th { text-align: right; }
.th-sort { display: inline-flex; align-items: center; gap: 4px; }
.sort-arrows { display: inline-flex; flex-direction: column; line-height: 0.7; }
.sort-arrow { color: #484f58; text-decoration: none; font-size: 8px; }
.sort-arrow:hover { color: #8b949e; }
.sort-arrow.active { color: #58a6ff; }
.rank-num { color: #6e7681; font-variant-numeric: tabular-nums; text-align: right; }
.rank-score { color: #bc8cff; font-weight: 600; }

/* Badges */
.badge { display: inline-block; padding: 2px 6px; border-radius: 4px; font-size: 11px; background: #21262d; color: #8b949e; margin: 1px; white-space: nowrap; }
.badge-framework { background: #1f2937; color: #93c5fd; }
.badge-green { background: #0d2818; color: #3fb950; }
.badge-blue { background: #0c2d6b; color: #58a6ff; }
.badge-gray { background: #21262d; color: #8b949e; }
.badge-red { background: #3d1418; color: #f85149; }
.badge-yellow { background: #3d2e00; color: #d29922; }

/* Lang bar */
.lang-bar { display: flex; gap: 16px; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid #21262d; }
.lang-item { display: flex; gap: 6px; align-items: center; font-size: 13px; }
.lang-name { color: #8b949e; }
.lang-count { font-weight: 600; }

/* Detail page */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.detail-card { background: #161b22; border: 1px solid #30363d; border-radius: 8px; padding: 16px; }
.detail-row { padding: 4px 0; font-size: 13px; }
.detail-row span:first-child { color: #8b949e; display: inline-block; min-width: 110px; }

/* Form */
.edit-form { background: #161b22; border: 1px solid #30363d; border-radius: 8px; padding: 24px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group.full-width { grid-column: 1 / -1; }
label { font-size: 12px; color: #8b949e; text-transform: uppercase; letter-spacing: 0.5px; }
input, select, textarea { background: #0d1117; border: 1px solid #30363d; border-radius: 6px; padding: 8px 10px; color: #e1e4e8; font-size: 14px; font-family: inherit; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #1f6feb; }
textarea { resize: vertical; }

@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .controls { flex-direction: column; align-items: stretch; }
  .search-input { width: 100%; }
}
