:root {
  color-scheme: dark;
  font-family: 'Plus Jakarta Sans', Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  background: #11131b;
  color: #f7f8fc;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

.staff-login-shell {
  align-items: center;
  background:
    radial-gradient(circle at 75% 18%, rgba(255, 126, 0, 0.12), transparent 34%),
    #11131b;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.staff-login-card {
  background: #171a25;
  border: 1px solid #343a4b;
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
  max-width: 430px;
  padding: 28px;
  width: 100%;
}

.staff-login-brand {
  align-items: center;
  display: flex;
  gap: 14px;
}

.staff-login-brand img {
  height: 58px;
  object-fit: contain;
  width: 70px;
}

.staff-login-card h1 { font-size: 26px; }
.staff-login-card > p { color: #9ca8bb; margin: 0; }
.staff-login-card .brand { color: #ff8c00; font-size: 11px; font-weight: 800; letter-spacing: 0.14em; margin: 0; }
.staff-login-card label { color: #cbd3df; display: grid; font-size: 12px; font-weight: 700; gap: 7px; }
.staff-login-card button { min-height: 44px; width: 100%; }
.staff-login-card #login-message { color: #ffb4c1; }

main {
  margin: auto;
  max-width: 1320px;
  padding: 36px 24px;
}

header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 24px;
}

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

.staff-identity {
  color: #9ca8bb;
  font-size: 12px;
  font-weight: 700;
}

header .brand {
  color: #ff8c00;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  margin: 0;
}

h1 {
  font-size: 30px;
  font-weight: 800;
  margin: 6px 0 0;
}

h2 {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
}

/* Cards Section */
.cards {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(5, 1fr);
  margin-bottom: 24px;
}

.cards article,
.panel {
  background: #171a25;
  border: 1px solid #292f3f;
  border-radius: 12px;
}

.cards article {
  padding: 18px;
}

.cards span,
.section-title small {
  color: #8e9bb0;
  font-size: 12px;
}

.cards strong {
  color: #ffffff;
  display: block;
  font-size: 24px;
  font-weight: 800;
  margin-top: 7px;
}

/* Navigation Tabs Bar */
.admin-tabs {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #171a25;
  border: 1px solid #292f3f;
  border-radius: 12px;
  padding: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: #8e9bb0;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 16px;
  transition: all 0.2s ease;
}

.tab-btn svg {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}

.tab-btn:hover {
  background: #202434;
  color: #ffffff;
}

.tab-btn:hover svg {
  transform: translateY(-1px);
}

.tab-btn.active {
  background: linear-gradient(135deg, #ff8c00 0%, #e65600 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(255, 140, 0, 0.25);
}

.tab-btn.active svg {
  stroke: #ffffff;
}

/* Panel & Content */
.panel {
  margin-top: 16px;
  padding: 20px;
}

.section-title {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
}

form {
  display: grid;
  gap: 12px;
  grid-template-columns: 1.35fr 1.35fr 2fr 1fr 1.25fr auto;
  align-items: end;
}

label {
  color: #bcc6d8;
  display: grid;
  font-size: 12px;
  font-weight: 700;
  gap: 6px;
}

input,
select {
  background: #11131c;
  border: 1px solid #333a4c;
  border-radius: 8px;
  color: #fff;
  font: inherit;
  min-height: 40px;
  padding: 0 12px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus {
  border-color: #ff8c00;
  box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.15);
}

button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  min-height: 40px;
  padding: 0 16px;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

button:active {
  transform: scale(0.98);
}

.primary {
  background: linear-gradient(135deg, #ff8c00 0%, #e65600 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(255, 140, 0, 0.2);
}

.primary:hover {
  background: linear-gradient(135deg, #ffa01a 0%, #f06400 100%);
}

.secondary {
  background: #212534;
  border: 1px solid #363d50;
  color: #fff;
}

.secondary:hover {
  background: #292e40;
}

.danger {
  background: #3d1c23;
  border: 1px solid #9c3b50;
  color: #ffb5c0;
  min-height: 32px;
}

.compact {
  margin: 2px 4px 2px 0;
  min-height: 32px;
  padding: 0 12px;
}

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  border-top: 1px solid #262b3a;
  padding: 14px 10px;
  text-align: left;
}

th {
  border: 0;
  color: #8c97ac;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

td {
  font-size: 13px;
}

.status {
  font-size: 11px;
  font-weight: 800;
  display: inline-block;
}

.active {
  background: transparent;
  color: #22c55e;
  border: none;
  padding: 0;
}

.suspended,
.expired {
  background: transparent;
  color: #ff4d4d;
  border: none;
  padding: 0;
}

.pending {
  background: transparent;
  color: #ffd875;
  border: none;
  padding: 0;
}

.empty {
  color: #8e9bb0;
  text-align: center;
  padding: 24px;
}

#message {
  border-radius: 8px;
  margin: 0 0 16px;
  padding: 12px;
  font-weight: 600;
}

.error {
  background: rgba(217, 48, 37, 0.16);
  border: 1px solid #9c3b50;
  color: #ffb5c0;
}

.success {
  background: rgba(255, 140, 0, 0.16);
  border: 1px solid #ff8c00;
  color: #ffc48a;
}

.webhook-grid {
  display: block;
}

.webhook-room-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.webhook-group {
  background: #12151f;
  border: 1px solid #2b3243;
  border-radius: 10px;
  margin-bottom: 16px;
  padding: 16px;
}

.webhook-group-title {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
}

.webhook-group-title h3 {
  font-size: 15px;
  margin: 0;
}

.webhook-group-title span {
  color: #ff9a3c;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.webhook-room-grid label {
  grid-template-columns: 1fr auto;
  align-items: end;
}

.webhook-room-grid label > input {
  grid-column: 1 / -1;
}

.webhook-save {
  margin-top: 2px;
}

.webhook-status {
  align-self: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.webhook-status.is-configured {
  background: transparent;
  color: #22c55e;
  border: none;
  padding: 0;
}

.webhook-status.is-empty {
  background: transparent;
  color: #8e9bb0;
  border: none;
  padding: 0;
}

.history-button {
  background: #222838;
  border: 1px solid #3c455d;
  color: #ff9a3c;
  font-size: 25px;
  line-height: 1;
  min-height: 34px;
  padding: 0;
  width: 38px;
}

.history-button:hover {
  background: #2b3244;
  border-color: #ff8c00;
}

.drawer-backdrop {
  background: rgba(4, 6, 10, .58);
  inset: 0;
  opacity: 0;
  position: fixed;
  transition: opacity .18s ease;
  z-index: 50;
}

.drawer-backdrop.open {
  opacity: 1;
}

.activity-drawer {
  background: #131620;
  border-left: 1px solid #343b4d;
  bottom: 0;
  box-shadow: -24px 0 60px rgba(0, 0, 0, .45);
  padding: 22px;
  position: fixed;
  right: 0;
  top: 0;
  transform: translateX(100%);
  transition: transform .18s ease;
  width: min(460px, 94vw);
  z-index: 51;
}

.activity-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  align-items: flex-start;
  border-bottom: 1px solid #2b3140;
  margin: 0 0 16px;
  padding-bottom: 16px;
}

.drawer-header small {
  color: #8e9bb0;
  display: block;
  font-size: 12px;
  margin-top: 5px;
}

.drawer-close {
  background: #222635;
  border: 1px solid #373e50;
  color: #fff;
  font-size: 23px;
  min-height: 36px;
  padding: 0;
  width: 36px;
}

.drawer-tabs {
  background: #0f1119;
  border: 1px solid #2a3040;
  border-radius: 9px;
  display: grid;
  gap: 4px;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
}

.drawer-platform-filter {
  background: #0f1119;
  border: 1px solid #2a3040;
  border-radius: 9px;
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 10px;
  padding: 4px;
}

.platform-filter {
  background: transparent;
  color: #8e9bb0;
  min-height: 34px;
  padding: 0 10px;
}

.platform-filter.active {
  background: #2a2f3e;
  color: #ff9a3c;
}

.drawer-tab {
  background: transparent;
  color: #8e9bb0;
  min-height: 38px;
}

.drawer-tab.active {
  background: #262b39;
  color: #ff9a3c;
}

.drawer-events {
  bottom: 22px;
  left: 22px;
  overflow: auto;
  position: absolute;
  right: 22px;
  top: 226px;
}

.event-card {
  background: #191d29;
  border: 1px solid #303748;
  border-left: 3px solid #22c55e;
  border-radius: 9px;
  margin-bottom: 10px;
  padding: 13px;
}

.event-card.miss-event {
  border-left-color: #f05252;
}

.event-card header {
  align-items: start;
  margin: 0 0 12px;
}

.event-card header strong {
  font-size: 13px;
  max-width: 58%;
}

.event-card time,
.event-card small {
  color: #8893a7;
  font-size: 10px;
}

.event-card dl {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, 1fr);
  margin: 0 0 10px;
}

.event-card dt {
  color: #8e9bb0;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.event-card dd {
  font-size: 11px;
  font-weight: 700;
  margin: 4px 0 0;
}

.event-card .positive { color: #54dc91; }
.event-card .negative { color: #ff8585; }

.drawer-empty {
  color: #8e9bb0;
  padding: 48px 12px;
  text-align: center;
}

.report-filters {
  grid-template-columns: 1fr 1fr 1.2fr auto;
  margin-bottom: 16px;
}

.report-summary {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 240px));
  margin-bottom: 16px;
}

.report-summary article {
  background: #11141d;
  border: 1px solid #2b3243;
  border-radius: 10px;
  padding: 14px 16px;
}

.report-summary span,
.moderator-card small,
.moderator-stats span {
  color: #8e9bb0;
  display: block;
  font-size: 11px;
}

.report-summary strong {
  display: block;
  font-size: 20px;
  margin-top: 6px;
}

.report-highlight {
  color: #ff9a3c;
  font-weight: 800;
}

.moderator-form {
  grid-template-columns: 1fr 1.2fr auto;
  max-width: 760px;
}

.moderator-list {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.moderator-filter {
  align-items: end;
  background: #11141d;
  border: 1px solid #2b3243;
  border-left: 3px solid #ff7900;
  border-radius: 10px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(180px, 280px) 1fr;
  margin-top: 18px;
  padding: 13px 15px;
}

.moderator-filter label { color: #f7f7f5; font-size: 12px; font-weight: 800; grid-column: 1; }
.moderator-filter select { grid-column: 1; }
.moderator-filter span { color: #8e9bb0; font-size: 11px; grid-column: 2; grid-row: 2; }

.moderator-card {
  background: #11141d;
  border: 1px solid #2b3243;
  border-radius: 11px;
  padding: 16px;
}

.moderator-heading {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.moderator-heading strong {
  display: block;
  margin-bottom: 5px;
}

.moderator-stats {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, 1fr);
  margin: 16px 0;
}

.moderator-stats div {
  background: #191d29;
  border-radius: 8px;
  padding: 10px;
}

.moderator-stats strong {
  display: block;
  font-size: 13px;
  margin-top: 4px;
}

.moderator-actions { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.moderator-actions button { width: 100%; }

.audit-title {
  border-top: 1px solid #292f3f;
  margin-top: 20px;
  padding-top: 20px;
}

@media(max-width: 900px) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
  form {
    grid-template-columns: 1fr 1fr;
  }
  .webhook-room-grid {
    grid-template-columns: 1fr 1fr;
  }
  .moderator-list {
    grid-template-columns: 1fr;
  }
  .moderator-filter { grid-template-columns: 1fr; }
  .moderator-filter span { grid-column: 1; grid-row: auto; }
  .table-wrap {
    overflow: auto;
  }
}

@media(max-width: 560px) {
  .cards {
    grid-template-columns: 1fr 1fr;
  }
  form,
  .webhook-room-grid {
    grid-template-columns: 1fr;
  }
}
