/* ===== 베이스 ===== */
* { box-sizing: border-box; }
body {
  font-family: "Pretendard Variable", "Pretendard", -apple-system, BlinkMacSystemFont,
               "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  margin: 0; background: #f5f7fb; color: #1e293b;
  font-size: 14.5px; line-height: 1.65;
  letter-spacing: -0.1px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3 { margin: 0; }

/* ===== 로그인 ===== */
.login-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1e3a8a 0%, #6366f1 100%);
}
.login-card {
  background: #fff; padding: 48px 40px; border-radius: 16px;
  width: 100%; max-width: 420px; box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.login-card .brand { font-size: 26px; font-weight: 800; color: #1e3a8a; }
.login-card .subtitle { color: #64748b; margin: 8px 0 28px; font-size: 14px; }
.login-card label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 6px; color: #334155; }
.login-card input {
  width: 100%; padding: 11px 14px; border: 1.5px solid #e2e8f0; border-radius: 10px;
  font-size: 14px; outline: none;
}
.login-card input:focus { border-color: #6366f1; }
.login-card button {
  width: 100%; margin-top: 24px; padding: 13px; border: 0; border-radius: 10px;
  background: #1e3a8a; color: #fff; font-size: 15px; font-weight: 700; cursor: pointer;
}
.login-card button:hover { background: #1e40af; }
.login-card .error { background: #fef2f2; color: #dc2626; padding: 10px 14px; border-radius: 8px; font-size: 13px; }
.login-card .hint { color: #94a3b8; font-size: 12px; margin-top: 18px; }

/* ===== 대시보드 ===== */
.topbar {
  display: flex; align-items: center; gap: 24px; padding: 14px 28px;
  background: #fff; border-bottom: 1px solid #e2e8f0;
}
.brand-mini { font-weight: 800; color: #1e3a8a; }
.univ { font-weight: 700; }
.univ .dim { color: #94a3b8; font-weight: 400; font-size: 13px; }
.topbar .logout { margin-left: auto; color: #64748b; font-size: 13px; }
.topbar .topnav { display: flex; gap: 18px; margin-left: 28px; }
.topbar .topnav a { color: #64748b; font-size: 13px; font-weight: 600; padding: 6px 4px; border-bottom: 2px solid transparent; }
.topbar .topnav a.active { color: #1e3a8a; border-bottom-color: #1e3a8a; }
.topbar .topnav a:hover { color: #1e3a8a; text-decoration: none; }

.dash { padding: 24px 28px; max-width: 1400px; margin: 0 auto; }

.summary {
  display: grid; grid-template-columns: 1.4fr repeat(5, 1fr); gap: 14px; margin-bottom: 24px;
}
.card {
  background: #fff; border-radius: 12px; padding: 18px; box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.card .label { font-size: 12px; color: #64748b; font-weight: 600; }
.card .value { font-size: 28px; font-weight: 800; margin-top: 6px; }
.card .unit { font-size: 12px; color: #94a3b8; }
.card.score { background: linear-gradient(135deg, #1e3a8a, #6366f1); color: #fff; }
.card.score .label { color: rgba(255,255,255,.85); }
.card.score .value { color: #fff; font-size: 36px; }
.card.pos .value { color: #22c55e; }
.card.neu .value { color: #94a3b8; }
.card.neg .value { color: #ef4444; }
.card.alert .value { color: #f59e0b; }

.charts { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; margin-bottom: 28px; }
.chart-box { background: #fff; padding: 20px; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.chart-box h3 { font-size: 14px; color: #334155; margin-bottom: 14px; }
.chart-box canvas { max-height: 260px; }

.sec-title { font-size: 15px; color: #334155; margin: 16px 0 12px; }

.channels { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 28px; }
.ch-card { background: #fff; padding: 14px; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.ch-name { font-size: 12px; color: #64748b; font-weight: 700; }
.ch-total { font-size: 22px; font-weight: 800; margin: 4px 0 10px; }
.ch-bars { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: #f1f5f9; }
.ch-bars .bar.pos { background: #22c55e; }
.ch-bars .bar.neu { background: #cbd5e1; }
.ch-bars .bar.neg { background: #ef4444; }
.ch-legend { display: flex; justify-content: space-between; font-size: 11px; margin-top: 6px; }
.ch-legend .pos { color: #16a34a; } .ch-legend .neu { color: #64748b; } .ch-legend .neg { color: #dc2626; }

.serp { background: #fff; padding: 20px; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.05); margin-bottom: 28px; }
.serp-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.serp-tabs button {
  border: 1.5px solid #e2e8f0; background: #fff; padding: 8px 18px; border-radius: 8px;
  font-size: 13px; font-weight: 600; cursor: pointer; color: #64748b;
}
.serp-tabs button.active { background: #1e3a8a; color: #fff; border-color: #1e3a8a; }
.serp-meta { font-size: 12px; color: #94a3b8; margin-bottom: 12px; }
.serp-list { list-style: none; padding: 0; margin: 0; }
.serp-item { display: flex; gap: 14px; padding: 12px; border-radius: 8px; margin-bottom: 6px; background: #f8fafc; }
.serp-item.sent-positive { border-left: 4px solid #22c55e; }
.serp-item.sent-neutral { border-left: 4px solid #cbd5e1; }
.serp-item.sent-negative { border-left: 4px solid #ef4444; background: #fef2f2; }
.serp-rank { font-size: 22px; font-weight: 800; color: #1e3a8a; min-width: 32px; }
.serp-title { font-size: 14px; font-weight: 700; }
.serp-snippet { font-size: 12px; color: #64748b; margin-top: 4px; }
.serp-tag { font-size: 11px; color: #94a3b8; margin-top: 4px; font-weight: 600; }

.neg-table { width: 100%; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.05); border-collapse: collapse; }
.neg-table th, .neg-table td { padding: 12px 14px; text-align: left; font-size: 13px; border-bottom: 1px solid #f1f5f9; }
.neg-table th { background: #f8fafc; color: #475569; font-weight: 700; font-size: 12px; }
.neg-table td.neg { color: #ef4444; font-weight: 700; }
.neg-table td.dim { color: #94a3b8; font-size: 11px; }
.neg-table td.reason { color: #64748b; font-size: 12px; max-width: 360px; }

.dim { color: #94a3b8; }
