* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #081224;
  color: #e5e7eb;
}

button, input, textarea, select {
  font: inherit;
}

button {
  cursor: pointer;
}

.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a, #111827);
}

.login-card {
  width: 360px;
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 22px;
}

.login-card .muted {
  color: #9ca3af;
  margin-bottom: 14px;
}

.login-card input,
.login-card button {
  width: 100%;
  padding: 11px 12px;
  border-radius: 9px;
  border: 1px solid #374151;
  margin-bottom: 10px;
}

.login-card input {
  background: #0b1220;
  color: #fff;
}

.login-card button {
  background: #2563eb;
  color: #fff;
  border: none;
}

.error {
  color: #fca5a5;
  min-height: 20px;
}

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 210px;
  background: #0c1628;
  border-right: 1px solid #1b2942;
  padding: 18px;
}

.brand {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 18px;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-btn {
  text-align: left;
  background: transparent;
  color: #d1d5db;
  border: 1px solid transparent;
  padding: 11px 13px;
  border-radius: 12px;
}

.menu-btn.active,
.menu-btn:hover {
  background: #1a273d;
  border-color: #324663;
  color: #fff;
}

.main {
  flex: 1;
  padding: 18px;
  background: #06101f;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.top-title {
  font-size: 22px;
  font-weight: 700;
}

.switches {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: #d1d5db;
  font-size: 14px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.card {
  background: #0b1628;
  border: 1px solid #1c2a43;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 8px 20px rgba(0,0,0,.18);
}

.card.narrow {
  max-width: 720px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.card-head h2 {
  margin: 0;
  font-size: 16px;
}

.compact-head h2 {
  font-size: 16px;
}

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

.toolbar-right input {
  min-width: 260px;
  height: 36px;
  font-size: 13px;
  padding: 0 12px;
}

.toolbar-right button {
  height: 36px;
  padding: 0 14px;
  font-size: 13px;
}

input, textarea, select {
  background: #081224;
  color: #fff;
  border: 1px solid #31415f;
  padding: 10px 12px;
  border-radius: 8px;
}

button {
  background: #2f66e8;
  color: #fff;
  border: none;
  padding: 10px 12px;
  border-radius: 8px;
}

.btn-warn {
  background: #d97706;
}

.btn-danger {
  background: #dc2626;
}

.form-grid {
  display: grid;
  gap: 10px;
}

.muted-block,
.mini-muted {
  color: #8ea0bc;
  font-size: 12px;
}

.member-table-head {
  display: grid;
  grid-template-columns: 220px 220px 240px 280px 300px;
  gap: 8px;
  padding: 0 0 8px;
  color: #8ea0bc;
  font-size: 12px;
  font-weight: 700;
  min-width: 1280px;
}

.member-list {
  display: grid;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.member-row-5 {
  display: grid;
  grid-template-columns: 220px 220px 240px 280px 300px;
  gap: 8px;
  align-items: stretch;
  min-width: 1280px;
}

.member-col {
  background: #0a1323;
  border: 1px solid #22304a;
  border-radius: 10px;
  padding: 10px;
  font-size: 12px;
  line-height: 1.45;
  min-width: 0;
  word-break: break-word;
  min-height: 168px;
}

.col-title {
  color: #cfd8e6;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 7px;
}

.col-line {
  margin-bottom: 4px;
}

.verify-inline-box {
  margin-top: 6px;
}

.verify-inline-item {
  border-top: 1px dashed #2d3c59;
  padding-top: 5px;
  margin-top: 5px;
  font-size: 11px;
}

.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
}

.status-badge.online {
  background: rgba(34,197,94,.18);
  color: #4ade80;
  border: 1px solid rgba(34,197,94,.25);
}

.status-badge.offline {
  background: rgba(148,163,184,.12);
  color: #cbd5e1;
  border: 1px solid rgba(148,163,184,.2);
}

.member-col-actions .action-list-compact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.member-col-actions button,
.member-col-actions select {
  min-height: 32px;
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 8px;
}

.member-col-actions select {
  background: #081224;
  color: #fff;
  border: 1px solid #31415f;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 14px;
  align-items: start;
}

.detail-left,
.detail-right {
  min-width: 0;
}

.sticky-detail-card {
  position: sticky;
  top: 18px;
}

.complete-list {
  display: grid;
  gap: 8px;
}

.complete-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #0a1323;
  border: 1px solid #22304a;
  border-radius: 10px;
  padding: 10px 12px;
}

.complete-row-main {
  min-width: 0;
}

.complete-no {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.complete-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: #c6d0de;
}

.btn-complete-detail {
  min-width: 64px;
  height: 34px;
  font-size: 12px;
  padding: 0 12px;
}

.detail-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.detail-mini-card {
  background: #0a1323;
  border: 1px solid #22304a;
  border-radius: 10px;
  padding: 10px;
  font-size: 12px;
  line-height: 1.5;
}

.detail-span-all {
  grid-column: 1 / -1;
}

.mini-block-line {
  border-top: 1px dashed #2d3c59;
  margin-top: 5px;
  padding-top: 5px;
  font-size: 11px;
}

.log-line {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-top: 1px dashed #2d3c59;
  margin-top: 5px;
  padding-top: 5px;
  font-size: 11px;
}

.event-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.event-list li {
  background: #0a1323;
  border: 1px solid #22304a;
  border-radius: 10px;
  padding: 10px;
}

.event-time {
  color: #8ea0bc;
  font-size: 12px;
  margin-bottom: 4px;
}

.event-text {
  color: #fff;
  font-size: 13px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.stat-card {
  background: #0b1628;
  border: 1px solid #1c2a43;
  border-radius: 12px;
  padding: 16px;
}

.stat-card span {
  display: block;
  color: #8ea0bc;
  margin-bottom: 8px;
  font-size: 13px;
}

.stat-card strong {
  font-size: 26px;
}

@media (max-width: 1200px) {
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .sticky-detail-card {
    position: static;
  }
}

@media (max-width: 980px) {
  .member-table-head,
  .member-row-5 {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .toolbar-right {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-right input {
    min-width: 0;
    width: 100%;
  }

  .complete-row {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 840px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .grid-4 {
    grid-template-columns: 1fr;
  }
}