@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&family=DM+Mono:wght@400;500&display=swap');

/* ── CSS VARIABLES ── */
:root {
  --bg: #0d0d10;
  --bg2: #15151a;
  --bg3: #1c1c24;
  --border: rgba(255,255,255,0.08);
  --border2: rgba(255,255,255,0.14);
  --text: #f0eef8;
  --text2: #9995b0;
  --text3: #5a5670;
  --accent: #a78bfa;
  --accent2: #7c3aed;
  --accent-dim: rgba(167,139,250,0.12);
  --green: #34d399;
  --green-dim: rgba(52,211,153,0.12);
  --red: #f87171;
  --red-dim: rgba(248,113,113,0.12);
  --amber: #fbbf24;
  --amber-dim: rgba(251,191,36,0.12);
  --blue: #60a5fa;
  --blue-dim: rgba(96,165,250,0.12);
  --pink: #f472b6;
  --pink-dim: rgba(244,114,182,0.12);
  --radius: 10px;
  --radius-sm: 6px;
}

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

body {
  font-family: 'Noto Sans JP', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
}

/* ── LAYOUT ── */
#app { display: flex; height: 100vh; overflow: hidden; }

/* ── SIDEBAR ── */
#sidebar {
  width: 200px;
  min-width: 200px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 0;
}
.sidebar-logo {
  padding: 20px 16px 14px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo h1 {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.sidebar-logo p {
  font-size: 10px;
  color: var(--text3);
  margin-top: 2px;
  font-family: 'DM Mono', monospace;
}
.sidebar-nav { flex: 1; padding: 10px 8px; overflow-y: auto; }
.nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text2);
  font-size: 13px;
  font-family: 'Noto Sans JP', sans-serif;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  position: relative;
}
.nav-btn .icon { font-size: 15px; opacity: 0.7; flex-shrink: 0; }
.nav-btn:hover { background: var(--bg3); color: var(--text); }
.nav-btn.active { background: var(--accent-dim); color: var(--accent); }
.nav-btn.active .icon { opacity: 1; }
.nav-badge {
  margin-left: auto;
  background: var(--accent2);
  color: #fff;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 10px;
  font-family: 'DM Mono', monospace;
}
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text3);
  font-family: 'DM Mono', monospace;
}

/* ── MAIN CONTENT ── */
#main {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--bg);
}
.panel { display: none; }
.panel.active { display: block; animation: fadeIn 0.2s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── PAGE HEADER ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.page-header h2 {
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(90deg, var(--text) 60%, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.page-header .subtitle {
  font-size: 12px;
  color: var(--text3);
  margin-top: 2px;
  font-family: 'DM Mono', monospace;
}

/* ── CARDS ── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.card-header h3 {
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── GRIDS ── */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
@media (max-width: 700px) {
  .grid2, .grid3, .grid4 { grid-template-columns: 1fr 1fr; }
}

/* ── STAT CARDS ── */
.stat {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.stat-val {
  font-size: 24px;
  font-weight: 700;
  font-family: 'DM Mono', monospace;
  color: var(--accent);
}
.stat-lbl { font-size: 11px; color: var(--text3); margin-top: 2px; }

/* ── FORM ELEMENTS ── */
.form-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.form-row label {
  font-size: 12px;
  color: var(--text2);
  min-width: 80px;
  flex-shrink: 0;
}
input[type=text],
input[type=number],
select,
textarea {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-size: 13px;
  color: var(--text);
  font-family: 'Noto Sans JP', sans-serif;
  outline: none;
  transition: border-color 0.15s;
}
input[type=text]:focus,
input[type=number]:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
}
input[type=text], select { width: 100%; }
input.w-sm  { width: 80px; }
input.w-md  { width: 110px; }
select option { background: var(--bg3); }
textarea { width: 100%; resize: vertical; }
input[type=checkbox] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
  cursor: pointer;
}
input[type=range] { accent-color: var(--accent); width: 100%; cursor: pointer; }

/* ── BUTTONS ── */
.btn {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border2);
  background: var(--bg3);
  color: var(--text);
  font-size: 13px;
  font-family: 'Noto Sans JP', sans-serif;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn:hover { background: var(--bg2); }
.btn-primary { background: var(--accent2); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #6d28d9; }
.btn-success { background: transparent; border-color: var(--green); color: var(--green); }
.btn-success:hover { background: var(--green-dim); }
.btn-danger  { background: transparent; border-color: var(--red); color: var(--red); }
.btn-danger:hover  { background: var(--red-dim); }
.btn-lg { padding: 10px 24px; font-size: 14px; font-weight: 500; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* ── BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  font-family: 'DM Mono', monospace;
}
.badge-purple { background: var(--accent-dim); color: var(--accent); }
.badge-green  { background: var(--green-dim);  color: var(--green);  }
.badge-amber  { background: var(--amber-dim);  color: var(--amber);  }
.badge-blue   { background: var(--blue-dim);   color: var(--blue);   }
.badge-red    { background: var(--red-dim);    color: var(--red);    }
.badge-pink   { background: var(--pink-dim);   color: var(--pink);   }
.badge-gray   { background: rgba(255,255,255,0.06); color: var(--text2); }

/* ── TABLES ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}
tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg3); }

/* ── MEMBER TAGS ── */
.tag-list { display: flex; gap: 6px; flex-wrap: wrap; }
.mtag {
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  font-size: 12px;
  color: var(--text2);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.mtag:hover { border-color: var(--accent); color: var(--accent); }
.mtag.selected { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }

/* ── WEIGHT SLIDERS ── */
.weight-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.weight-row .wlabel {
  font-size: 12px;
  color: var(--text2);
  min-width: 160px;
  flex-shrink: 0;
}
.weight-row .wval {
  font-size: 13px;
  font-weight: 500;
  font-family: 'DM Mono', monospace;
  color: var(--accent);
  min-width: 22px;
  text-align: right;
}

/* ── DIVIDER ── */
.divider { border: none; border-top: 1px solid var(--border); margin: 14px 0; }

/* ── EMPTY STATE ── */
.empty { text-align: center; padding: 32px; color: var(--text3); font-size: 13px; }
.empty-icon { font-size: 32px; margin-bottom: 8px; }

/* ── DETAILS / SUMMARY ── */
details summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--text2);
  user-select: none;
  padding: 6px 0;
}
details summary:hover { color: var(--accent); }
details[open] summary { color: var(--accent); }
details .detail-body { margin-top: 12px; }

/* ── RESULT ── */
.win-row {
  background: var(--green-dim);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  margin-bottom: 4px;
}
.result-summary { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
