/* Kokpit — base styles (mockup'tan port) */
:root {
  --primary: #1a5490;
  --accent: #d4a017;
  --bg: #fafbfc;
  --card: #ffffff;
  --border: #e3e8ee;
  --text: #1a1a1a;
  --muted: #6b7280;
  --critical: #c0392b;
  --high: #d68910;
  --med: #229954;
  --low: #7f8c8d;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: linear-gradient(180deg, #1a2940 0%, #0d1929 100%);
  color: #d4dae3;
  padding: 24px 0;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .brand {
  padding: 0 24px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 16px;
}
.sidebar .brand-title { font-size: 16px; font-weight: 600; color: #fff; letter-spacing: 0.5px; }
.sidebar .brand-sub { font-size: 11px; color: #8a96a8; margin-top: 2px; letter-spacing: 1px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 24px;
  color: #b7c0cf;
  text-decoration: none;
  font-size: 14px;
  border-left: 3px solid transparent;
  transition: all 0.15s;
}
.sidebar nav a:hover { background: rgba(255,255,255,0.05); color: #fff; }
.sidebar nav a.active {
  background: rgba(212,160,23,0.12);
  color: #fff;
  border-left-color: var(--accent);
  font-weight: 500;
}
.sidebar .footer {
  position: absolute; bottom: 24px; left: 0; right: 0;
  padding: 0 24px;
  color: #5a6577;
  font-size: 11px;
}
.sidebar .footer a {
  color: #8a96a8;
  text-decoration: none;
}
.sidebar .footer a:hover { color: #fff; }

.main { padding: 32px 40px; max-width: 1200px; }
.page-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  padding-bottom: 16px; margin-bottom: 24px;
  border-bottom: 2px solid var(--border);
}
.page-head h1 { font-size: 22px; font-weight: 600; }
.page-head .date {
  font-size: 12px; color: var(--muted);
  letter-spacing: 1px; text-transform: uppercase;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
}
.card-title {
  font-size: 13px; font-weight: 600;
  letter-spacing: 1px; text-transform: uppercase;
  color: var(--primary); margin-bottom: 12px;
}

.badge {
  display: inline-block; padding: 2px 8px;
  border-radius: 4px; font-size: 11px; font-weight: 600;
}
.badge-critical { background: #fde8e6; color: var(--critical); }
.badge-high { background: #fef3e0; color: var(--high); }
.badge-med { background: #e8f8ec; color: var(--med); }
.badge-low { background: #f0f3f5; color: var(--low); }

.muted { color: var(--muted); }

input, select, button, textarea {
  font-family: inherit; font-size: 13px;
  padding: 8px 12px; border: 1px solid var(--border);
  border-radius: 6px; background: #fff;
}
button {
  background: var(--primary); color: white; border: none; cursor: pointer;
  font-weight: 500;
}
button:hover { opacity: 0.9; }

/* Demo banner */
.demo-banner {
  background: repeating-linear-gradient(45deg, #fef9ed, #fef9ed 10px, #fff 10px, #fff 20px);
  border: 2px dashed #d4a017; border-radius: 8px;
  padding: 10px 16px; margin-bottom: 20px;
  display: flex; gap: 14px; align-items: center;
  font-size: 12px; color: #8b6c0d;
}
.demo-banner .badge-tag {
  background: #d4a017; color: white; padding: 3px 10px;
  border-radius: 4px; font-weight: 700; font-size: 11px; letter-spacing: 1px;
}

/* Hero */
.brief-hero {
  background: linear-gradient(135deg, #1a5490 0%, #2c3e50 100%);
  color: white; padding: 28px; border-radius: 10px;
  margin-bottom: 16px; position: relative;
}
.brief-hero .label { font-size: 11px; letter-spacing: 2px; opacity: 0.8; margin-bottom: 8px; }
.brief-hero h2 { font-size: 24px; font-weight: 600; margin-bottom: 8px; line-height: 1.3; }
.brief-hero p { opacity: 0.92; font-size: 14px; line-height: 1.55; }
.brief-hero .ai-stamp {
  position: absolute; top: 14px; right: 18px;
  background: rgba(255,255,255,0.18); padding: 5px 12px;
  border-radius: 4px; font-size: 10px; letter-spacing: 1px;
  display: flex; gap: 6px; align-items: center; font-family: 'SF Mono', monospace;
}

.sources-summary { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 14px 18px; margin-bottom: 16px; }
.sources-summary .label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; font-weight: 700; }
.src-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.src-pill {
  background: #f8fafc; border: 1px solid var(--border);
  padding: 4px 10px; border-radius: 12px;
  font-size: 11px; color: #475569; cursor: pointer;
  display: flex; gap: 6px; align-items: center; text-decoration: none;
}
.src-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: #15803d; }
.src-pill .dot.stale { background: #d4a017; }
.src-pill .dot.error { background: #b91c1c; }

.brief-tldr {
  background: #fff; border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  padding: 16px 20px; margin-bottom: 12px; border-radius: 0 8px 8px 0;
}
.brief-tldr .label {
  font-size: 11px; letter-spacing: 1px; color: var(--primary);
  font-weight: 600; margin-bottom: 6px;
  display: flex; justify-content: space-between; align-items: center;
}
.brief-tldr p { font-size: 14px; line-height: 1.6; color: #1f2937; }

.section-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 20px; }

.trend-row {
  display: flex; justify-content: space-between; align-items: center;
  color: inherit; text-decoration: none; padding: 6px 0;
  border-bottom: 1px solid #f0f3f5; font-size: 13px;
}
.trend-row:last-child { border-bottom: none; }
.trend-meta { color: var(--muted); font-size: 11px; }

/* Login */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1a2940 0%, #0d1929 100%);
}
.login-card {
  background: #fff; padding: 38px 42px; border-radius: 12px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.4); width: 360px;
}
.login-card h1 { font-size: 18px; color: var(--primary); margin-bottom: 4px; }
.login-card .sub { color: var(--muted); font-size: 12px; margin-bottom: 24px; letter-spacing: 1px; text-transform: uppercase; }
.login-card input[type="password"] {
  width: 100%; padding: 12px 14px;
  border: 2px solid var(--border); border-radius: 6px;
  font-size: 14px; margin-bottom: 12px;
}
.login-card input[type="password"]:focus { border-color: var(--primary); outline: none; }
.login-card button {
  width: 100%; padding: 12px; font-size: 14px; font-weight: 600;
  background: var(--primary); color: white; border: none; border-radius: 6px;
  cursor: pointer;
}
.login-card .error {
  background: #fde8e6; color: var(--critical);
  padding: 10px 14px; border-radius: 6px; margin-bottom: 14px;
  font-size: 13px;
}

/* Filters */
.filters {
  display: flex; gap: 10px 14px; flex-wrap: wrap;
  background: #fff; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: 8px;
  margin-bottom: 16px; align-items: flex-end;
}
.filters .group { display: flex; flex-direction: column; align-items: stretch; gap: 5px; }
.filters .group.grow { flex: 1 1 240px; min-width: 200px; }
.filters label {
  font-size: 10px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600;
}
.filters select,
.filters input[type="text"],
.filters input[type="date"] { height: 36px; padding: 0 10px; font-size: 13px; }
.filters button[type="submit"] { height: 36px; padding: 0 20px; }
.date-nav { display: flex; align-items: center; gap: 6px; }
.date-nav a, .date-nav button {
  background: #fff; border: 1px solid var(--border);
  width: 34px; height: 36px; border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--primary); text-decoration: none;
}
.date-nav a.disabled { color: var(--muted); pointer-events: none; opacity: 0.4; }

.tag-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.chip {
  background: #f0f4f8; padding: 4px 10px; border-radius: 12px;
  font-size: 11px; color: var(--primary); cursor: pointer;
  border: 1px solid transparent; text-decoration: none;
}
.chip.active { background: var(--primary); color: #fff; }
.chip:hover { border-color: var(--primary); }
.chip .freq { color: var(--muted); font-size: 9px; margin-left: 4px; }

/* Article cards */
.article-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 16px;
  transition: box-shadow 0.15s;
}
.article-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.score-cell { text-align: center; }
.score-icon { font-size: 24px; }
.score-num {
  font-weight: 700; font-size: 13px;
  margin-top: 2px;
}
.article-meta {
  color: var(--muted); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px;
}
.article-title { font-size: 15px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.article-summary { color: #444; font-size: 13px; line-height: 1.6; margin-bottom: 10px; }
.article-actions {
  display: flex; gap: 12px; align-items: center;
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid #f0f3f5;
  font-size: 12px;
}
.action-link {
  color: var(--primary); text-decoration: none;
  display: inline-flex; align-items: center; gap: 4px;
  font-weight: 500;
  background: none; border: none; cursor: pointer; padding: 0;
}
.tag-list { color: var(--muted); font-size: 11px; font-style: italic; margin-left: auto; }
.results-count { color: var(--muted); font-size: 12px; margin-bottom: 16px; }
.full-text {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 14px; line-height: 1.7; color: #2a2a2a;
  white-space: pre-wrap;
  max-height: 360px; overflow-y: auto;
  padding: 12px; background: #fff; border: 1px solid #eef0f3; border-radius: 4px;
  margin-top: 8px;
}
.yh-yorum {
  background: #fef9ed; border-left: 3px solid var(--accent);
  padding: 8px 12px; margin-top: 10px;
  font-size: 13px; color: #5a4a0d;
}

@media (max-width: 768px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .section-grid { grid-template-columns: 1fr; }
  .article-card { grid-template-columns: 50px 1fr; padding: 14px; }
}
