:root {
  --bg: #0e1a24;
  --card: #122332;
  --accent: #3ccf91;
  --accent-2: #f2b347;
  --text: #e6eef6;
  --muted: #9fb2c3;
  --border: #1e3142;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top, #1b2f42, #0e1a24 55%);
  min-height: 100vh;
}

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

a:hover {
  color: var(--accent);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 6vw;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 18, 26, 0.9);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand a {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.6px;
}

.site-nav {
  display: flex;
  gap: 16px;
  align-items: center;
}

.site-main {
  padding: 32px 6vw 48px;
}

.site-footer {
  padding: 20px 6vw 32px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

.btn {
  background: var(--accent);
  color: #0b141b;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 700;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.btn.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.hero {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: center;
}

.hero-text h1 {
  font-size: clamp(28px, 4vw, 42px);
  margin: 0 0 12px;
}

.hero-card {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

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

.table th,
.table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
}

.pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--accent-2);
}

.form {
  display: grid;
  gap: 12px;
}

.form input,
.form select,
.form textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0b141b;
  color: var(--text);
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inline {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  margin-right: 12px;
  margin-bottom: 8px;
}

.inline-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.permissions-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.perm-option {
  text-align: left;
}

.thread {
  display: grid;
  gap: 16px;
  margin-bottom: 24px;
}

.message {
  padding: 16px;
  border-radius: 12px;
  background: #0b141b;
  border: 1px solid var(--border);
}

.message-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.message-body {
  margin: 0;
  white-space: pre-wrap;
  font-family: inherit;
  color: var(--text);
}

.attachments {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.tile {
  padding: 18px;
  border-radius: 12px;
  background: #0b141b;
  border: 1px solid var(--border);
  font-weight: 600;
}

.meta {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--muted);
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0b141b;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 20;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.toast a {
  color: var(--accent);
  font-weight: 700;
}

.highlight {
  background: rgba(60, 207, 145, 0.1);
}

.modal {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0;
  background: var(--card);
  color: var(--text);
  max-width: none;
  width: min(720px, 90vw);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal::backdrop {
  background: rgba(10, 20, 30, 0.8);
}

.modal-content {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 20px;
  width: 100%;
  opacity: 0;
  transform: translateY(6px) scale(0.98);
  transition: opacity 0.2s ease, transform 0.2s ease;
  color: var(--text);
}

.modal-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.modal[open] .modal-content,
.modal.open .modal-content {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.permission-grid .perm-option.is-active {
  background: var(--accent) !important;
  color: #0b141b !important;
  border-color: transparent !important;
}

.modal-header h4 {
  margin: 0 0 12px;
}

.modal-body {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

@media (max-width: 700px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .site-nav {
    flex-wrap: wrap;
  }
}
