@import url('https://fonts.googleapis.com/css2?family=Maven+Pro:wght@400;500&display=swap');

:root {
  --white: #ffffff;
  --gray-50: #f7f7f8;
  --gray-100: #eeeeef;
  --gray-200: #dcdcde;
  --gray-400: #a9a9ad;
  --gray-600: #6f6f74;
  --gray-800: #3a3a3d;
  --green: #3fb950;
  --yellow: #d9a441;
  --orange: #e07b1a;
  --red: #d7192d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Maven Pro', sans-serif;
  font-weight: 400;
  background: var(--gray-50);
  color: var(--gray-800);
}

a { color: inherit; text-decoration: none; }

header.topbar {
  background: var(--red);
  border-bottom: 1px solid var(--red);
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

header.topbar .brand { font-size: 18px; color: var(--white); font-weight: 500; }
header.topbar nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
header.topbar nav a {
  margin-left: 0;
  background: var(--white);
  color: var(--red);
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 999px;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}
header.topbar nav a.active, header.topbar nav a:hover { background: var(--gray-800); color: var(--white); }
header.topbar .logout-link { background: transparent; color: var(--white); border: 1px solid rgba(255,255,255,0.6); }
header.topbar .logout-link:hover { background: var(--white); color: var(--red); border-color: var(--white); }

h1 { color: var(--gray-800); }

button.primary { background: var(--red); }

.dot.orange { background: var(--orange); }
.dot.yellow { background: var(--yellow); }
.dot.red { background: var(--red); }
.dot.grey { background: var(--gray-400); }

.roster-table { width: 100%; border-collapse: collapse; }
.roster-table th {
  text-align: left;
  font-size: 12px;
  color: var(--gray-600);
  padding: 8px 10px;
  border-bottom: 1px solid var(--gray-200);
}
.roster-table td {
  padding: 10px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
  vertical-align: middle;
}
.roster-table img.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--gray-200); vertical-align: middle; margin-right: 8px; }
.roster-num { color: var(--gray-400); width: 34px; }
.roster-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }

.stat-box { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 8px; padding: 12px 14px; margin-bottom: 8px; }
.stat-box .stat-label { font-size: 12px; color: var(--gray-600); }
.stat-box .stat-value { font-size: 18px; font-weight: 500; }

.banner-days {
  position: relative;
  width: 100%;
  height: 44vh;
  max-height: 340px;
  border-radius: 12px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.banner-days::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.05) 55%, rgba(0,0,0,0.75) 100%);
}
.banner-days .banner-days-text {
  position: relative;
  z-index: 1;
  color: var(--white);
  font-size: 42px;
  font-weight: 500;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px;
}

h1 { font-size: 22px; font-weight: 500; margin-bottom: 4px; }
h2 { font-size: 17px; font-weight: 500; }
p.sub { color: var(--gray-600); font-size: 14px; margin-top: 0; }

.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 16px;
}

label {
  display: block;
  font-size: 13px;
  color: var(--gray-600);
  margin: 14px 0 6px;
}

input[type=text], input[type=color], input[type=date], input[type=time], input[type=number], input[type=url], textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  background: var(--gray-50);
  color: var(--gray-800);
}

textarea { min-height: 80px; resize: vertical; }

button {
  font-family: inherit;
  font-weight: 400;
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 14px;
}

button.primary { background: var(--gray-800); color: var(--white); }
button.secondary { background: var(--gray-100); color: var(--gray-800); }
button.danger { background: var(--red); color: var(--white); }
button.ghost { background: transparent; color: var(--gray-600); border: 1px solid var(--gray-200); }
button:disabled { opacity: 0.5; cursor: default; }
button + button { margin-left: 8px; }

.row { display: flex; gap: 12px; }
.row > * { flex: 1; }

.checkbox-line { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.checkbox-line label { margin: 0; }

.question-item { display: flex; gap: 8px; margin-bottom: 8px; }
.question-item input { flex: 1; }

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--gray-100);
}
.list-item:last-child { border-bottom: none; }

.user-block { display: flex; align-items: center; gap: 12px; }
.user-block img { width: 36px; height: 36px; border-radius: 50%; background: var(--gray-200); }
.user-name { font-size: 14px; }
.user-roles { font-size: 12px; color: var(--gray-600); }

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--gray-600);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gray-400); }
.dot.verified { background: var(--green); }
.status-dot.verified { color: var(--green); }

.tag {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 20px;
  margin-left: 8px;
}
.tag.yellow { background: #fdf2df; color: var(--yellow); }
.tag.red { background: #fbe6e6; color: var(--red); }

.actions { display: flex; align-items: center; gap: 8px; }

.member-picker {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  margin-top: 8px;
}
.member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
}
.member-row img { width: 26px; height: 26px; border-radius: 50%; }
.member-row input[type=checkbox] { margin-left: auto; }

.hidden { display: none !important; }

.empty { color: var(--gray-400); font-size: 14px; text-align: center; padding: 40px 0; }

.answers-box {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 12px;
  margin-top: 8px;
  font-size: 13px;
}
.answers-box b { display: block; margin-bottom: 2px; color: var(--gray-800); }
.answers-box p { margin: 0 0 10px; color: var(--gray-600); }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(58, 58, 61, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.modal-box {
  background: var(--white);
  border-radius: 12px;
  padding: 24px;
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
}

.modal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.modal-head img { width: 44px; height: 44px; border-radius: 50%; background: var(--gray-200); }

.modal-body b { display: block; margin: 12px 0 2px; color: var(--gray-800); font-size: 13px; }
.modal-body p { margin: 0; color: var(--gray-600); font-size: 14px; }

.image-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.image-grid img { width: 110px; height: 110px; object-fit: cover; border-radius: 8px; border: 1px solid var(--gray-200); }

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--gray-800);
  color: var(--white);
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 13px;
}

/* ---- Grouped navigation ---- */
header.topbar nav.grouped-nav { gap: 6px; }
.nav-group { position: relative; }
.nav-group-btn {
  background: var(--white); color: var(--red); border: 0; font: inherit; font-size: 13px; font-weight: 500;
  padding: 7px 14px; border-radius: 999px; cursor: pointer; transition: background .15s ease, color .15s ease;
}
.nav-group.active > .nav-group-btn, .nav-group-btn:hover, .nav-group.open > .nav-group-btn { background: var(--gray-800); color: var(--white); }
.nav-group .caret { font-size: 10px; margin-left: 2px; }
.nav-menu {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; min-width: 210px; z-index: 50;
  background: var(--white); border: 1px solid var(--gray-200); border-radius: 12px; padding: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.nav-group.open .nav-menu { display: block; }
header.topbar .nav-menu a {
  display: block; background: transparent; color: var(--gray-800); border-radius: 8px; padding: 9px 12px; font-size: 13px;
}
header.topbar .nav-menu a:hover, header.topbar .nav-menu a.current { background: var(--gray-100); color: var(--red); }
@media (max-width: 720px) { .nav-menu { position: static; box-shadow: none; margin-top: 4px; } .nav-group { width: 100%; } }

/* ---- Server settings page ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }
.health-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--gray-100); font-size: 13px; }
.health-row .pill { flex: none; min-width: 58px; text-align: center; border-radius: 999px; padding: 2px 8px; font-size: 11px; color: #fff; }
.pill.ok { background: var(--green); } .pill.error { background: var(--red); } .pill.warn { background: var(--yellow); } .pill.empty { background: var(--gray-400); }
.source-row { border: 1px solid var(--gray-200); border-radius: 10px; padding: 12px; margin-bottom: 10px; background: var(--gray-50); }
.rule-row { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 8px; margin-bottom: 8px; align-items: end; }
pre.out { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 8px; padding: 10px; font-size: 12px; overflow: auto; max-height: 280px; white-space: pre-wrap; }
.warn-box { background: #fff7e6; border: 1px solid var(--yellow); border-radius: 10px; padding: 10px 14px; font-size: 13px; margin-bottom: 12px; }
