/* AI Creator OS Dashboard v1.0 */
:root {
  --blue: #2563eb;
  --purple: #7c3aed;
  --green: #16a34a;
  --yellow: #d97706;
  --orange: #f97316;
  --red: #dc2626;
  --gray-50:  #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-600: #6b7280;
  --gray-800: #1f2937;
  --white: #ffffff;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.07);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Noto Sans JP', sans-serif;
  background: var(--gray-100);
  color: var(--gray-800);
  font-size: 14px;
  line-height: 1.5;
}

.header {
  background: #1a2744;
  color: #fff;
  padding: 20px 0;
  text-align: center;
}
.header h1 { font-size: 20px; font-weight: 800; }
.header p  { font-size: 12px; opacity: 0.7; margin-top: 4px; }

.container { max-width: 900px; margin: 0 auto; padding: 20px 16px; }

h2 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--gray-800);
}

.section { margin-bottom: 20px; }

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.kpi-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  text-align: center;
}
.kpi-num {
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 6px;
}
.kpi-label {
  font-size: 11px;
  color: var(--gray-600);
}
.kpi-card.blue   .kpi-num { color: var(--blue); }
.kpi-card.purple .kpi-num { color: var(--purple); }
.kpi-card.green  .kpi-num { color: var(--green); }
.kpi-card.yellow .kpi-num { color: var(--yellow); }

/* Cards */
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

/* Mistake DB */
.rank-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-100);
}
.rank-row:last-child { border-bottom: none; }
.rank-pos   { font-size: 13px; font-weight: 700; color: var(--gray-400); width: 20px; flex-shrink: 0; }
.rank-label { font-size: 13px; min-width: 160px; }
.rank-bar-wrap { flex: 1; height: 8px; background: var(--gray-100); border-radius: 4px; }
.rank-bar { height: 8px; background: var(--purple); border-radius: 4px; }
.rank-count { font-size: 12px; color: var(--gray-600); flex-shrink: 0; }
.pb-badge {
  font-size: 10px;
  background: #ede9fe;
  color: #5b21b6;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

/* Daily bar chart */
.bar-chart {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  height: 100px;
}
.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.bar-inner {
  width: 100%;
  height: 70px;
  display: flex;
  align-items: flex-end;
}
.bar-fill {
  width: 100%;
  min-height: 2px;
  background: var(--blue);
  border-radius: 4px 4px 0 0;
  transition: height 0.6s ease;
}
.bar-label { font-size: 10px; color: var(--gray-400); }
.bar-count { font-size: 11px; font-weight: 700; color: var(--blue); min-height: 16px; }

/* Score trend */
.trend-chart {
  display: flex;
  gap: 6px;
  align-items: flex-end;
  height: 110px;
}
.trend-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.trend-bar-wrap {
  width: 100%;
  height: 80px;
  display: flex;
  align-items: flex-end;
}
.trend-bar {
  width: 100%;
  min-height: 4px;
  border-radius: 4px 4px 0 0;
  transition: height 0.6s ease;
}
.trend-ok   { background: var(--green); }
.trend-warn { background: var(--yellow); }
.trend-fix  { background: var(--orange); }
.trend-stop { background: var(--red); }
.trend-num  { font-size: 11px; font-weight: 700; }
.trend-date { font-size: 9px; color: var(--gray-400); }

/* Misc */
.empty-state { text-align: center; padding: 60px 20px; color: var(--gray-600); line-height: 2; }
.empty-state a { color: var(--blue); }
.muted { color: var(--gray-400); font-size: 13px; }
.note  { font-size: 11px; color: var(--gray-400); text-align: center; margin-top: 16px; }

footer { text-align: center; padding: 20px; font-size: 11px; color: var(--gray-400); }

@media (max-width: 600px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
