:root {
  color: #e7f1ff;
  background: #050606;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #050606;
}

a { color: #00ff66; text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, select {
  min-height: 34px;
  border: 1px solid #26364b;
  border-radius: 4px;
  background: #080a0d;
  color: #eef6ff;
  font: inherit;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  cursor: pointer;
}

button:hover { border-color: #00ff66; color: #00ff66; }

.primary { border-color: #00d655; background: #001f10; color: #00ff66; }
.danger { border-color: #7d2431; background: #250808; color: #ff667f; }

.shell {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.topbar {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px;
  border-bottom: 1px solid #1b1f27;
  background: #050606;
}

.brand {
  display: grid;
  gap: 2px;
  color: #00ff66;
  text-transform: uppercase;
}

.brand strong, .section-title span {
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 14px;
  letter-spacing: 0;
}

.brand span, .section-title small {
  color: #6f86a7;
  font-size: 12px;
}

.toolbar {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  border-bottom: 1px solid #1b1f27;
  background: #090a0c;
}

.section-title span, .section-title small { display: block; }
.section-title span { color: #00ff66; font-weight: 800; text-transform: uppercase; }
.section-title small { margin-top: 4px; }

.flash-stack {
  display: grid;
  gap: 6px;
  padding: 10px 14px 0;
}

.flash {
  padding: 9px 10px;
  border: 1px solid #26364b;
  border-radius: 4px;
  background: #080a0d;
}

.flash.error { border-color: #7d2431; color: #ffb7c2; }
.flash.ok { border-color: #116e37; color: #00ff66; }

.filters {
  padding: 10px 14px;
  border-bottom: 1px solid #1b1f27;
}

.filters form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 180px 180px auto auto;
  gap: 8px;
  align-items: center;
}

.filters input, .filters select, .stack-form input {
  width: 100%;
  padding: 0 10px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #9fc4ee;
}

.check input { min-height: auto; }

.panel {
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding: 12px 14px;
}

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

.bulk-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.select-all {
  min-height: 34px;
}

.data-table {
  width: 100%;
  border: 1px solid #1b1f27;
  border-collapse: collapse;
  background: #080a0d;
}

.data-table th {
  position: sticky;
  top: 0;
  padding: 9px 10px;
  border-bottom: 1px solid #26364b;
  background: #101217;
  color: #6f86a7;
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 11px;
  text-align: left;
  text-transform: uppercase;
}

.data-table td {
  padding: 10px;
  border-bottom: 1px solid #171c24;
  color: #dbe9ff;
  font-size: 13px;
  vertical-align: top;
}

.data-table .row-select {
  width: 54px;
  text-align: center;
}

.data-table input[type="checkbox"] {
  min-height: auto;
}

.data-table tr.unread td { color: #ffffff; font-weight: 700; }
.empty { height: 180px; text-align: center; color: #6f86a7; }

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.message-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  min-height: 0;
  flex: 1;
}

.meta-panel {
  padding: 14px;
  border-right: 1px solid #1b1f27;
  overflow: auto;
  background: #080a0d;
}

.meta-panel dl {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
}

.meta-panel dt {
  color: #6f86a7;
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 10px;
  text-transform: uppercase;
}

.meta-panel dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: #dbe9ff;
  font-size: 12px;
}

.meta-panel h2 {
  margin: 18px 0 8px;
  color: #00ff66;
  font-size: 12px;
  text-transform: uppercase;
}

.token-row {
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid #26364b;
  border-radius: 4px;
  background: #050606;
}

.token-row a { overflow-wrap: anywhere; font-size: 12px; }
.token-row small, .muted { color: #6f86a7; font-size: 12px; }
.token-row.revoked { opacity: .55; }

.message-body, .shared-body {
  min-width: 0;
  padding: 18px;
  overflow: auto;
  background: #f6f8fb;
  color: #111820;
}

.message-body a, .shared-body a { color: #0067c5; }
.message-body img, .shared-body img { max-width: 100%; }

.login-panel {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 20px;
}

.login-card {
  display: grid;
  width: min(420px, 100%);
  gap: 18px;
  padding: 18px;
  border: 1px solid #26364b;
  border-radius: 6px;
  background: #080a0d;
}

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

.stack-form label {
  display: grid;
  gap: 6px;
  color: #6f86a7;
  font-size: 12px;
}

@media (max-width: 900px) {
  .toolbar, .topbar { align-items: stretch; flex-direction: column; padding: 12px; }
  .filters form { grid-template-columns: 1fr; }
  .message-layout { grid-template-columns: 1fr; }
  .meta-panel { border-right: 0; border-bottom: 1px solid #1b1f27; }
}
