:root {
  --bg: #0f141e;
  --panel: #161d2b;
  --panel-2: #1c2536;
  --border: #2a364c;
  --text: #e6ecf5;
  --muted: #8fa0b8;
  --accent: #38bdf8;
  --accent-2: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --eve-gold: #eab308;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 18px;
  background: rgba(15, 20, 30, 0.96);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.brand-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.brand-title { font-weight: 700; font-size: 15px; letter-spacing: -0.02em; color: #fff; }

.mode-switch {
  display: inline-flex;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.mode-switch a {
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.mode-switch a.active {
  background: var(--accent);
  color: #08101c;
  text-decoration: none;
}
.mode-switch a.active.eve { background: var(--eve-gold); color: #111; }

.status-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text);
}
.pill.ok { border-color: rgba(34, 197, 94, 0.4); }
.pill.warn { border-color: rgba(245, 158, 11, 0.5); color: #fcd34d; }
.pill.danger { border-color: rgba(239, 68, 68, 0.6); color: #fca5a5; }

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.green { background: var(--accent-2); }
.dot.red { background: var(--danger); animation: pulse 1.2s infinite; }
.dot.amber { background: var(--warn); }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(1.25); }
}

.sisters { display: flex; gap: 6px; align-items: center; }
.sister-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--panel);
  border: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #07101c; }
.btn.success { background: var(--accent-2); border-color: var(--accent-2); color: #06180d; }
.btn.warn { background: var(--warn); border-color: var(--warn); color: #161103; }
.btn.danger { background: rgba(239, 68, 68, 0.16); border-color: rgba(239, 68, 68, 0.45); color: #fca5a5; }
.btn.sm { padding: 3px 8px; font-size: 12px; }

.container { max-width: 1640px; margin: 0 auto; padding: 14px 18px 40px; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1.05fr 1.25fr 1.1fr;
  gap: 14px;
  align-items: start;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

@media (max-width: 1180px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 14px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.card-title { font-size: 14px; font-weight: 700; margin: 0; }

input[type="text"],
input[type="number"],
input[type="date"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 7px 10px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: #0d121b;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.inline-form { display: flex; gap: 6px; margin-top: 8px; }
.inline-form input { flex: 1; }

.task-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 6px;
}
.task-row:hover { background: rgba(255, 255, 255, 0.03); }
.task-main { display: flex; align-items: flex-start; gap: 8px; flex: 1; }
.task-main input[type="checkbox"] { margin-top: 3px; cursor: pointer; }
.task-done { text-decoration: line-through; color: var(--muted); }
.subtask-list { margin-left: 24px; border-left: 1px dashed var(--border); padding-left: 8px; }

table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th, td { padding: 7px 8px; border-bottom: 1px solid var(--border); text-align: left; }
th { color: var(--muted); font-weight: 600; background: rgba(255, 255, 255, 0.02); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.danger-row { background: rgba(239, 68, 68, 0.12); }
tr.warn-row { background: rgba(245, 158, 11, 0.11); }

.chunk-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
}
.chunk-meta { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(56, 189, 248, 0.16);
  color: #7dd3fc;
}
.badge.green { background: rgba(34, 197, 94, 0.18); color: #86efac; }
.badge.amber { background: rgba(245, 158, 11, 0.18); color: #fcd34d; }
.badge.red { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }

.suggest-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  margin-top: 4px;
  background: rgba(15, 20, 30, 0.6);
  border-radius: 6px;
  font-size: 12px;
}

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tab-btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
}
.tab-btn.active { background: var(--eve-gold); border-color: var(--eve-gold); color: #111; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

.meter-wrap { width: 64px; height: 8px; background: #0a0f18; border-radius: 99px; overflow: hidden; border: 1px solid var(--border); }
.meter-bar { height: 100%; width: 0%; background: var(--accent-2); transition: width 0.08s linear; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 15, 0.78);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 80;
  padding: 16px;
}
.modal-backdrop.open { display: flex; }
.modal-box {
  width: 100%;
  max-width: 780px;
  max-height: 90vh;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;
  background: #1e293b;
  border: 1px solid var(--accent);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  display: none;
}
.toast.show { display: block; }
