:root {
  --navy: #1E2761;
  --ice: #CADCFC;
  --ink: #1c1c28;
  --muted: #6b6b7a;
  --line: #e2e4ec;
  --bg: #f6f7fb;
  --good: #1c8a4a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Noto Sans KR", "Malgun Gothic", -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  background: var(--navy);
  color: #fff;
}
.topbar .brand { color: #fff; font-weight: 700; text-decoration: none; }
.topbar nav a { color: var(--ice); text-decoration: none; margin-left: 16px; font-size: 14px; }
.topbar .tag { background: rgba(255,255,255,0.15); padding: 3px 10px; border-radius: 12px; font-size: 13px; }
.topbar .tag-link { text-decoration: none; color: #fff; transition: background .15s; }
.topbar .tag-link:hover { background: rgba(255,255,255,0.28); }

main { max-width: 1080px; margin: 0 auto; padding: 32px 24px 80px; }

h1 { font-size: 24px; margin-bottom: 4px; }
h2 { font-size: 17px; margin-top: 32px; }
.sub, .hint { color: var(--muted); font-size: 13px; }

.flash { max-width: 1080px; margin: 12px auto 0; padding: 10px 16px; background: #fff3cd; border: 1px solid #ffe08a; border-radius: 8px; }

.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-top: 20px; }
.team-card {
  display: block; padding: 20px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; text-decoration: none; color: var(--ink);
  transition: box-shadow .15s;
}
.team-card:hover { box-shadow: 0 4px 14px rgba(30,39,97,0.12); }
.team-card.done { border-color: var(--good); background: #f2fbf5; }
.team-name { font-weight: 700; font-size: 16px; margin-bottom: 8px; }
.team-state { font-size: 13px; color: var(--muted); }

.countdown {
  margin-top: 10px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
  background: #12172e;
  color: #7CFC9A;
  padding: 6px 10px;
  border-radius: 6px;
  text-align: center;
  width: fit-content;
}
.countdown.countdown-closed {
  background: #3a1f1f;
  color: #ff8a80;
  letter-spacing: 1px;
}

.card-form, .inline-form {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 24px; max-width: 420px; margin-top: 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.inline-form { flex-direction: row; align-items: center; max-width: none; padding: 12px 16px; }
.inline-form input { flex: 1; }

label { font-size: 13px; color: var(--muted); margin-top: 8px; }
input[type=text], input[type=password], select, textarea {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px;
  font-family: inherit; width: 100%;
}
textarea { resize: vertical; }

button, .primary-btn, .secondary-btn, .link-btn {
  cursor: pointer; border: none; border-radius: 8px; font-size: 14px; font-weight: 600;
  padding: 10px 16px; font-family: inherit;
}
.primary-btn { background: var(--navy); color: #fff; }
.primary-btn:disabled { background: #b7bcd6; cursor: not-allowed; }
.secondary-btn { background: #fff; border: 1px solid var(--navy); color: var(--navy); text-decoration: none; display: inline-block; }
.secondary-btn:disabled { opacity: .5; cursor: not-allowed; }
.link-btn { background: none; color: var(--navy); text-decoration: underline; padding: 0; font-weight: 500; }

.action-row { display: flex; gap: 10px; margin-top: 16px; align-items: center; }
.save-msg { font-size: 12px; color: var(--muted); margin-top: 8px; }

.notice { padding: 12px 16px; border-radius: 8px; margin: 16px 0; font-size: 14px; }
.notice.submitted { background: #eafaf0; border: 1px solid #b7ebc8; }

.editor-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 16px; }
@media (max-width: 860px) { .editor-layout { grid-template-columns: 1fr; } }

.item-row {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 14px; margin-bottom: 12px;
}
.item-row-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.item-index { font-size: 12px; color: var(--muted); font-weight: 700; }
.remove-btn { background: none; border: none; color: #c0392b; font-size: 12px; text-decoration: underline; padding: 0; }
.item-row input, .item-row textarea { margin-top: 6px; }

.status-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-top: 10px; }
.status-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px; font-size: 13px; }
.status-card.done { border-color: var(--good); background: #f2fbf5; }
.status-card .team-name { font-size: 14px; margin-bottom: 6px; }

.ppt-preview { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-top: 12px; overflow-x: auto; }
.ppt-table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.ppt-table th, .ppt-table td { border: 1px solid #b9bdd6; padding: 8px 10px; vertical-align: top; text-align: left; }
.ppt-table th { background: var(--navy); color: #fff; font-size: 12px; }
.dept-cell { text-align: center; font-weight: 700; white-space: nowrap; }
.bullet-item { margin: 0 0 8px; padding-left: 14px; position: relative; }
.bullet-item::before { content: "▪"; position: absolute; left: 0; top: 0; font-size: 10px; }
.bullet-item strong { font-weight: 700; }
.bullet-item span { color: #333; }
.bullet-item.compact-item { background: #f5f7ff; border-radius: 4px; padding: 2px 4px 2px 14px; }
.mode-badge { display: inline-block; margin-left: 8px; font-size: 10px; color: var(--muted); background: #eef0f7; border-radius: 8px; padding: 1px 7px; vertical-align: middle; }

.line-hint { font-size: 11px; color: var(--muted); margin-top: 4px; }

.notice.warn { background: #fdecea; border: 1px solid #f5b7b1; color: #922b21; }
.status-card.warn { border-color: #e07b4f; }
.warn-text { color: #c0392b; font-size: 12px; margin-top: 4px; font-weight: 600; }

.override-form select { font-size: 12px; padding: 4px 6px; width: 100%; }

.log-table { border-collapse: collapse; width: 100%; font-size: 13px; margin-top: 10px; background: #fff; }
.log-table th, .log-table td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.log-table th { background: #eef0f7; }
