:root {
  --bg: #050607;
  --bg2: #0a110e;
  --line: #2b4a3a;
  --text: #eefaf5;
  --muted: #a8c1b8;
  --green: #49f2a3;
  --yellow: #e7c75a;
  --red: #ef6f6f;
  --blue: #58a7f8;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 5% 8%, rgba(73, 242, 163, 0.17), transparent 35%),
    radial-gradient(circle at 92% 18%, rgba(34, 191, 123, 0.14), transparent 38%),
    linear-gradient(140deg, var(--bg), var(--bg2));
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-color: #050607;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  width: 46vmax;
  height: 46vmax;
  border-radius: 50%;
  filter: blur(80px);
  z-index: -1;
  opacity: .28;
  animation: drift 16s ease-in-out infinite alternate;
}

body::before {
  background: rgba(73, 242, 163, .28);
  top: -14vmax;
  left: -10vmax;
}

body::after {
  background: rgba(88, 167, 248, .24);
  bottom: -18vmax;
  right: -12vmax;
  animation-duration: 21s;
}

.container {
  width: min(1400px, calc(100% - 2rem));
  margin: 1rem auto 2rem;
  display: grid;
  gap: 1rem;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(9, 14, 11, 0.9), rgba(11, 20, 15, 0.8));
  padding: .95rem 1rem;
  animation: panelIn .45s ease both;
}

.login-panel {
  max-width: 520px;
  margin: 8vh auto;
  background:
    radial-gradient(circle at 88% 12%, rgba(73,242,163,.14), transparent 30%),
    linear-gradient(160deg, rgba(9, 14, 11, 0.94), rgba(11, 20, 15, 0.86));
}

.login-form {
  width: 100%;
  flex-direction: column;
  align-items: stretch;
}

.login-form input,
.login-form button {
  width: 100%;
}
.hidden { display: none !important; }
.row { display: flex; align-items: center; flex-wrap: wrap; }
.gap-8 { gap: .5rem; }
.gap-12 { gap: .75rem; }

#appBox {
  display: grid;
  gap: .62rem;
}

input, textarea, button, select {
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(8, 14, 11, 0.88);
  color: var(--text);
  padding: .6rem .7rem;
  font: inherit;
}

input::placeholder,
textarea::placeholder {
  color: #9fb8af;
}

select option {
  background: #0f1713;
  color: #eefaf5;
}

textarea { width: 100%; min-height: 54px; resize: vertical; }
button { cursor: pointer; font-weight: 700; }
button:hover { filter: brightness(1.08); transform: translateY(-1px); }
button.secondary { background: rgba(79, 167, 120, .16); }
button.danger { background: rgba(239, 111, 111, .12); border-color: rgba(239,111,111,.45); }

.tabs {
  display: flex;
  gap: .45rem;
  flex-wrap: wrap;
  padding: .5rem;
  margin-top: -.12rem;
  margin-bottom: -.1rem;
}

.tab {
  background: rgba(255,255,255,.03);
  padding: .46rem .7rem;
  font-size: .86rem;
  border-radius: 9px;
}

.tab.active {
  background: linear-gradient(120deg, rgba(73,242,163,.22), rgba(34,191,123,.15));
  border-color: rgba(73,242,163,.6);
}

.legend { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; }
.chip { padding: .28rem .5rem; border-radius: 999px; border: 1px solid transparent; font-size: .85rem; }
.chip.green { background: rgba(73,242,163,.14); color: #83ffc7; border-color: rgba(73,242,163,.4); }
.chip.yellow { background: rgba(231,199,90,.14); color: #ffe390; border-color: rgba(231,199,90,.45); }
.chip.red { background: rgba(239,111,111,.14); color: #ff9898; border-color: rgba(239,111,111,.45); }
.chip.blue { background: rgba(88,167,248,.14); color: #95c8ff; border-color: rgba(88,167,248,.45); }

.tab-panel {
  display: grid;
  gap: .6rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
}

.member-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
}

.member-card {
  position: relative;
  text-align: left;
  width: 100%;
  border: 1px solid rgba(66, 92, 78, .45);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(8, 16, 12, 0.92), rgba(8, 18, 13, 0.75));
  padding: .8rem .86rem;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: .7rem;
  align-items: center;
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
  animation: cardIn .45s ease both;
}

.member-card:hover {
  transform: translateY(-2px);
  border-color: rgba(73,242,163,.55);
  box-shadow: 0 14px 28px rgba(0,0,0,.28);
}

.member-avatar,
.detail-avatar {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.04);
}

.member-main {
  display: grid;
  gap: .2rem;
}

.member-main strong { font-size: 1rem; }
.member-rank { color: #d9f8e9; font-weight: 600; }
.member-main small { color: var(--muted); }

.status-dot {
  position: absolute;
  top: .5rem;
  right: .55rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.4);
}

.dot-green { background: var(--green); box-shadow: 0 0 12px rgba(73,242,163,.9); }
.dot-yellow { background: var(--yellow); box-shadow: 0 0 12px rgba(231,199,90,.9); }
.dot-red { background: var(--red); box-shadow: 0 0 12px rgba(239,111,111,.9); }
.dot-blue { background: var(--blue); box-shadow: 0 0 12px rgba(88,167,248,.9); }

.status-pill {
  display: inline-block;
  border-radius: 999px;
  padding: .22rem .5rem;
  font-size: .8rem;
  border: 1px solid transparent;
}
.status-green { background: rgba(73,242,163,.14); color: #83ffc7; border-color: rgba(73,242,163,.4); }
.status-yellow { background: rgba(231,199,90,.14); color: #ffe390; border-color: rgba(231,199,90,.45); }
.status-red { background: rgba(239,111,111,.14); color: #ff9898; border-color: rgba(239,111,111,.45); }
.status-blue { background: rgba(88,167,248,.14); color: #95c8ff; border-color: rgba(88,167,248,.45); }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5,8,6,.44);
  backdrop-filter: blur(7px);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .22s ease, visibility .22s ease;
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-card {
  width: min(760px, 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(9, 14, 11, 0.98), rgba(11, 20, 15, 0.94));
  padding: 1.15rem;
  opacity: 0;
  transform: translateY(12px) scale(.985);
  transition: transform .22s ease, opacity .22s ease;
}

.modal-backdrop.open .modal-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
}

.detail-title-wrap {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.log-item {
  position: relative;
  border: 1px solid rgba(88, 129, 109, .38);
  border-radius: 14px;
  padding: .78rem .95rem;
  margin-bottom: .7rem;
  background:
    radial-gradient(circle at 92% 8%, rgba(73,242,163,.10), transparent 32%),
    linear-gradient(140deg, rgba(11, 19, 15, .92), rgba(9, 24, 17, .78));
  box-shadow: 0 12px 24px rgba(0, 0, 0, .22);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.log-item::before {
  content: "";
  position: absolute;
  left: .55rem;
  top: .75rem;
  bottom: .75rem;
  width: 3px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(73,242,163,.9), rgba(88,167,248,.75));
}

.log-item:hover {
  transform: translateY(-2px);
  border-color: rgba(73,242,163,.45);
  box-shadow: 0 16px 30px rgba(0, 0, 0, .28);
}

.log-top,
.log-main,
.log-meta {
  margin-left: .6rem;
}

.log-top {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin-bottom: .28rem;
}

.log-actor {
  font-weight: 700;
  color: #dffef0;
}

.log-action {
  font-size: .78rem;
  letter-spacing: .02em;
  border: 1px solid rgba(73,242,163,.4);
  border-radius: 999px;
  padding: .14rem .44rem;
  color: #b9f8d7;
  background: rgba(73,242,163,.10);
}

.log-main {
  color: #f2fff8;
  margin-bottom: .35rem;
}

.log-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .75rem;
  color: var(--muted);
  font-size: .84rem;
}

.error { color: #ff9d9d; min-height: 1.2rem; }
.hint { color: var(--muted); font-size: .9rem; }

.admin-list {
  display: grid;
  gap: .5rem;
  margin-top: .75rem;
}

.admin-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .5rem .65rem;
  border: 1px solid rgba(66, 92, 78, .45);
  border-radius: 10px;
  background: rgba(11, 19, 15, .6);
}

.overview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}

.overview-tools {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
}

.member-count-chip {
  border: 1px solid rgba(73,242,163,.4);
  border-radius: 999px;
  padding: .36rem .65rem;
  font-size: .86rem;
  color: #d5fbe9;
  background: linear-gradient(120deg, rgba(73,242,163,.16), rgba(34,191,123,.08));
}

.sort-wrap {
  display: flex;
  align-items: center;
  gap: .45rem;
  color: var(--muted);
  font-size: .9rem;
}

.manage-center {
  display: flex;
  justify-content: center;
}

.manage-card {
  width: 100%;
  min-height: 180px;
}

.manage-hero {
  border-color: rgba(73,242,163,.45);
  background:
    radial-gradient(circle at 90% 10%, rgba(73,242,163,.1), transparent 35%),
    linear-gradient(160deg, rgba(9, 14, 11, 0.95), rgba(11, 20, 15, 0.88));
}

.manage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .8rem;
}

.security-badges {
  margin-top: .45rem;
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes panelIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(3vmax, -2vmax, 0) scale(1.08); }
}

@media (max-width: 980px) {
  .grid-2 { grid-template-columns: 1fr; }
  .member-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .manage-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .member-grid { grid-template-columns: 1fr; }
  .container { width: calc(100% - 1rem); margin: .5rem auto 1rem; }
  .panel { padding: .75rem; border-radius: 13px; }
  .tab { padding: .42rem .58rem; font-size: .82rem; }
}
