* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  background: #f5f3f0;
  color: #1a1a1a;
  line-height: 1.6;
}

/* ── HEADER ── */
header {
  background: #8B1A1A;
  color: white;
  padding: 16px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.header-inner { max-width: 1200px; margin: 0 auto; }
header h1 {
  font-size: 1.15rem;
  font-weight: 700;
  font-family: 'Noto Serif JP', serif;
  display: flex;
  align-items: center;
  gap: 9px;
  letter-spacing: 0.01em;
}
header h1 .kamon { font-size: 1.3rem; opacity: 0.9; }
header .sub { font-size: 0.78rem; opacity: 0.65; margin-top: 3px; letter-spacing: 0.02em; }
header .badge {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.85);
  font-size: 0.66rem;
  padding: 1px 7px;
  border-radius: 3px;
  margin-left: 6px;
  letter-spacing: 0.04em;
}

/* ── FILTER BAR ── */
.filter-bar {
  background: #721616;
  padding: 8px 24px;
  border-bottom: 1px solid rgba(0,0,0,0.12);
}
.filter-bar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  width: 100%;
}
#filter-input {
  flex: 1;
  min-width: 180px;
  max-width: 280px;
  padding: 5px 12px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
  color: white;
  border-radius: 4px;
  font-size: 0.82rem;
}
#filter-input::placeholder { color: rgba(255,255,255,0.4); }
#filter-input:focus { outline: none; border-color: rgba(255,255,255,0.45); background: rgba(255,255,255,0.13); }
.chip {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.22);
  color: rgba(255,255,255,0.65);
  padding: 3px 11px;
  border-radius: 3px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}
.chip:hover { color: rgba(255,255,255,0.9); border-color: rgba(255,255,255,0.4); }
.chip.active { background: rgba(255,255,255,0.18); color: white; border-color: rgba(255,255,255,0.5); }

/* ── MAIN ── */
main { max-width: 1200px; margin: 0 auto; padding: 28px 24px 80px; }

/* ── KPI BAR ── */
.kpi-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.kpi-card {
  background: white;
  border: 1px solid #e2d9d0;
  border-radius: 6px;
  padding: 16px 14px 14px;
  text-align: center;
}
.kpi-card .num {
  font-size: 1.75rem;
  font-weight: 700;
  color: #8B1A1A;
  line-height: 1;
  letter-spacing: -0.02em;
}
.kpi-card .label { font-size: 0.7rem; color: #7a6e68; margin-top: 7px; line-height: 1.4; }
.kpi-card .sub-num { font-size: 0.7rem; color: #aaa098; margin-top: 3px; }

/* ── SECTION ── */
.section { margin-bottom: 40px; }
.section h2 {
  font-size: 0.72rem;
  font-weight: 700;
  color: #8B1A1A;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding-bottom: 10px;
  margin-bottom: 14px;
  border-bottom: 1px solid #e2d9d0;
  display: flex;
  align-items: center;
  gap: 7px;
}
/* 全カテゴリ統一 */
.section[data-cat] h2 { color: #8B1A1A; border-color: #e2d9d0; }

/* ── GRID ── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 10px;
}

/* ── TILE ── */
a.tile {
  background: white;
  border: 1px solid #e2d9d0;
  border-radius: 6px;
  padding: 14px 15px 12px;
  text-decoration: none;
  color: #1a1a1a;
  display: block;
  transition: box-shadow 0.15s, border-color 0.15s;
}
a.tile:hover {
  box-shadow: 0 3px 10px rgba(0,0,0,0.07);
  border-color: #b4a09a;
}
a.tile .tile-icon { font-size: 1.15rem; margin-bottom: 8px; display: block; opacity: 0.85; }
a.tile .tile-title { font-size: 0.86rem; font-weight: 600; line-height: 1.35; color: #1a1a1a; }
a.tile .tile-desc { font-size: 0.73rem; color: #7a6e68; margin-top: 5px; line-height: 1.5; }
a.tile .tile-status {
  display: inline-block;
  font-size: 0.65rem;
  padding: 2px 7px;
  border-radius: 3px;
  margin-top: 8px;
  letter-spacing: 0.03em;
}
.status-done { background: #edf6f0; color: #2a6040; }
.status-wip  { background: #fef6e4; color: #7a4a10; }
.status-todo { background: #f8eeee; color: #7a2020; }

/* カテゴリ色 → 全廃（ホバーのみ） */
a.tile.cat-form, a.tile.cat-drive,
a.tile.cat-sheet, a.tile.cat-doc, a.tile.cat-noco { border-left-width: 1px; }

/* ── DRIVE GRID ── */
.drive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}

/* ── COMMITTEE TABLE ── */
.committee-table { width: 100%; border-collapse: collapse; font-size: 0.83rem; }
.committee-table th {
  background: #f5f3f0;
  padding: 9px 14px;
  text-align: left;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: #5a2d1a;
  border-bottom: 1px solid #e2d9d0;
}
.committee-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f0ede9;
  vertical-align: top;
  line-height: 1.65;
}
.committee-table a { color: #8B1A1A; text-decoration: none; }
.committee-table a:hover { text-decoration: underline; }
.committee-table tr:last-child td { border-bottom: none; }
.committee-table tr:hover td { background: #fdf9f7; }

/* ── ALERT ── */
.alert {
  background: #fef9ed;
  border: 1px solid #e5d090;
  border-left: 3px solid #c9a227;
  border-radius: 5px;
  padding: 11px 16px;
  font-size: 0.8rem;
  color: #5a400a;
  margin-bottom: 24px;
  line-height: 1.65;
}
.alert strong { display: block; margin-bottom: 3px; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; }

/* ── HIDE/SHOW ── */
.hidden { display: none !important; }

/* ── KPI LOADING ── */
.kpi-card .num.loading { opacity: 0.25; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:0.25} 50%{opacity:0.65} }

/* ── KPI DASHBOARD ── */
.kpi-dash {
  background: white;
  border: 1px solid #e2d9d0;
  border-radius: 6px;
  padding: 20px 24px;
  margin-bottom: 20px;
}
.kpi-dash-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 10px;
}
.kpi-dash-header h3 {
  font-size: 0.72rem;
  font-weight: 700;
  color: #8B1A1A;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}
.kpi-dash-tab { display: flex; gap: 4px; }
.kpi-dash-tab button {
  border: 1px solid #e2d9d0;
  background: #f5f3f0;
  color: #7a6e68;
  padding: 4px 13px;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.12s;
}
.kpi-dash-tab button:hover { border-color: #c4a899; }
.kpi-dash-tab button.active { background: #8B1A1A; color: white; border-color: #8B1A1A; }

.kpi-dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.kpi-group-header {
  font-size: 0.84rem; font-weight: 700; color: #5a2d1a;
  padding: 6px 10px; margin: 8px 0 6px;
  background: #f5f3f0; border-left: 4px solid #8B1A1A; border-radius: 3px;
}
.btn-kpi-add {
  background: #8B1A1A; color: white; border: none;
  padding: 3px 10px; border-radius: 3px; font-size: 0.78rem;
  cursor: pointer; font-weight: 600; transition: background 0.15s;
}
.btn-kpi-add:hover { background: #6d1414; }
.btn-kpi-add:disabled { background: #ccc; cursor: not-allowed; }
.kpi-source-tag {
  font-size: 0.66rem; padding: 1px 5px; border-radius: 2px;
  margin-left: 6px; font-weight: 600;
}
.kpi-source-auto   { background: #d1fae5; color: #065f46; }
.kpi-source-manual { background: #fef3c7; color: #92400e; }
.kpi-item {
  background: #faf8f6;
  border: 1px solid #ece7e2;
  border-radius: 5px;
  padding: 13px 15px;
}
.kpi-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 9px;
  gap: 8px;
}
.kpi-item-label { font-size: 0.78rem; font-weight: 600; color: #3a2a20; line-height: 1.4; }
.kpi-item-badge {
  font-size: 0.64rem;
  padding: 2px 7px;
  border-radius: 3px;
  white-space: nowrap;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}
.badge-exceed, .badge-reach { background: #edf6f0; color: #2a6040; }
.badge-near    { background: #fef6e4; color: #7a4a10; }
.badge-miss    { background: #f8eeee; color: #7a2020; }
.badge-pending { background: #f0eff5; color: #4a4870; }
.badge-live    { background: #eef3fb; color: #2a4a7a; }

.kpi-item-values {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 8px;
}
.kpi-actual {
  font-size: 1.35rem;
  font-weight: 700;
  color: #8B1A1A;
  line-height: 1;
  letter-spacing: -0.02em;
}
.kpi-sep { font-size: 0.75rem; color: #b8aca4; }
.kpi-target { font-size: 0.8rem; color: #9a8880; }
.kpi-pct { font-size: 0.72rem; font-weight: 700; margin-left: auto; }
.pct-exceed { color: #2a6040; }
.pct-near   { color: #7a4a10; }
.pct-miss   { color: #7a2020; }

.progress-bar { height: 3px; background: #ede8e2; border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 2px; transition: width 0.7s ease; }
.fill-exceed, .fill-reach { background: #4a9e6a; }
.fill-near   { background: #c9a227; }
.fill-miss   { background: #9a3030; }
.fill-live   { background: #4a7ab5; }

.kpi-item-note { font-size: 0.68rem; color: #9a8880; margin-top: 8px; line-height: 1.55; }
.dash-panel { display: none; }
.dash-panel.active { display: block; }

/* ── CHART ── */
.chart-section {
  background: white;
  border: 1px solid #e2d9d0;
  border-radius: 6px;
  padding: 20px 24px;
  margin-bottom: 20px;
}
.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.chart-header h3 {
  font-size: 0.72rem;
  font-weight: 700;
  color: #8B1A1A;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}
.chart-fy-tab { display: flex; gap: 4px; }
.chart-fy-tab button {
  border: 1px solid #e2d9d0;
  background: #f5f3f0;
  color: #7a6e68;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.12s;
}
.chart-fy-tab button.active { background: #8B1A1A; color: white; border-color: #8B1A1A; }
.chart-wrap { position: relative; height: 200px; }
.chart-note { font-size: 0.68rem; color: #b0a098; margin-top: 10px; }

/* ── PUBLIC URL BOX ── */
.public-url-box {
  background: white;
  border: 1px solid #e2d9d0;
  border-radius: 6px;
  padding: 15px 18px;
  margin-bottom: 14px;
  font-size: 0.83rem;
}
.public-url-title {
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: #5a2d1a;
  margin-bottom: 11px;
  text-transform: uppercase;
}
.public-url-list { display: flex; flex-direction: column; gap: 8px; }
.pub-url-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pub-label { min-width: 110px; color: #5a2d1a; font-weight: 600; font-size: 0.78rem; }
.pub-link {
  color: #8B1A1A;
  text-decoration: none;
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  word-break: break-all;
}
.pub-link:hover { text-decoration: underline; }
.pub-copy {
  background: #f5f3f0;
  border: 1px solid #e2d9d0;
  color: #5a2d1a;
  padding: 3px 10px;
  border-radius: 3px;
  font-size: 0.7rem;
  cursor: pointer;
  transition: background 0.1s;
  white-space: nowrap;
}
.pub-copy:hover { background: #e8ddd5; }
