/* ===================================================================
 * Turby Admin — Discord-flavored dark theme.
 *
 * Palette (Discord-ish):
 *   --bg-darkest  #1e1f22  page background
 *   --bg-dark     #2b2d31  panels, cards
 *   --bg-card     #313338  raised surfaces (rows, inputs)
 *   --bg-input    #383a40  form inputs
 *   --border      #3a3c43  hairlines
 *   --text        #dbdee1  body text
 *   --text-bold   #f2f3f5  headings
 *   --text-muted  #b5bac1  secondary text
 *   --accent      #5865f2  blurple
 *   --accent-hi   #4752c4  blurple hover
 *   --danger      #ed4245
 *   --warn        #faa61a
 *   --ok          #57f287
 *   --link        #00a8fc
 * =================================================================== */

:root {
  color-scheme: dark;
  --bg-darkest: #1e1f22;
  --bg-dark: #2b2d31;
  --bg-card: #313338;
  --bg-input: #383a40;
  --border: #3a3c43;
  --text: #dbdee1;
  --text-bold: #f2f3f5;
  --text-muted: #b5bac1;
  --accent: #5865f2;
  --accent-hi: #4752c4;
  --danger: #ed4245;
  --danger-hi: #c43638;
  --warn: #faa61a;
  --warn-hi: #e8970d;
  --ok: #57f287;
  --link: #00a8fc;
  --link-hi: #2eb6ff;
  font-family: "gg sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg-darkest);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}

main {
  margin: 32px auto;
  max-width: 1100px;
  padding: 0 20px;
}

a {
  color: var(--link);
  text-decoration: none;
}
a:hover {
  color: var(--link-hi);
  text-decoration: underline;
}

/* --- topbar -------------------------------------------------------- */

.topbar {
  align-items: center;
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border);
  color: var(--text-bold);
  display: flex;
  gap: 18px;
  min-height: 52px;
  padding: 0 24px;
  font-size: 14px;
}

.topbar > strong {
  font-size: 16px;
  color: var(--text-bold);
}

.topbar a {
  color: var(--text);
  padding: 6px 10px;
  border-radius: 4px;
  transition: background 0.1s, color 0.1s;
}
.topbar a:hover {
  background: var(--bg-card);
  color: var(--text-bold);
  text-decoration: none;
}

.topbar nav {
  display: flex;
  gap: 4px;
}

.topbar > span {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 13px;
}

.topbar > a:last-child {
  color: var(--text-muted);
}

/* "Mod panel" pill button on the topbar (visible only to mods on /me) */
.topbar a.mod-panel-btn {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  padding: 6px 12px;
}
.topbar a.mod-panel-btn:hover {
  background: var(--accent-hi);
  color: #fff;
}

/* --- typography --------------------------------------------------- */

h1, h2, h3, h4 {
  color: var(--text-bold);
  font-weight: 700;
  margin: 0 0 12px;
}
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }

p { margin: 0 0 12px; }

code, pre {
  background: var(--bg-input);
  border-radius: 4px;
  color: var(--text-bold);
  font-family: "Consolas", ui-monospace, "Menlo", monospace;
}
code { padding: 2px 6px; }
pre {
  padding: 12px 14px;
  overflow-x: auto;
  border: 1px solid var(--border);
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

/* --- sections / panels -------------------------------------------- */

section {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 22px;
  margin: 0 0 20px;
}

section > h2:first-child {
  margin-top: 0;
}

/* --- tables ------------------------------------------------------- */

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

thead th {
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

tbody tr:hover {
  background: var(--bg-card);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* --- forms / inputs ----------------------------------------------- */

label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 13px;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
select,
textarea {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-bold);
  font: inherit;
  padding: 6px 10px;
  outline: none;
  transition: border-color 0.1s;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

textarea {
  display: block;
  width: 100%;
  max-width: 720px;
  min-height: 120px;
  font-family: "Consolas", ui-monospace, "Menlo", monospace;
}

/* --- buttons ------------------------------------------------------ */

button,
input[type="submit"],
.button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.1s;
}
button:hover,
input[type="submit"]:hover,
.button:hover {
  background: var(--accent-hi);
}

button.secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}
button.secondary:hover {
  background: var(--bg-input);
  color: var(--text-bold);
}

button.danger {
  background: var(--danger);
}
button.danger:hover {
  background: var(--danger-hi);
}

/* --- generic flash row -------------------------------------------- */

.flash, .me-flash {
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
}
.flash--ok,    .me-flash--ok    { border-color: #1f7a3a; background: #1a3d28; color: #b8f0c9; }
.flash--error, .me-flash--error { border-color: #a4222a; background: #3d1a1d; color: #f0b8bc; }
.flash--info,  .me-flash--info  { border-color: var(--accent); background: #2c3055; color: #d4daff; }

/* ===================================================================
 * /me page — Discord-embed-flavored card
 * =================================================================== */

.me-card {
  background: var(--bg-dark);
  color: var(--text);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 20px 24px;
  margin: 0 0 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px 32px;
  align-items: start;
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.me-card h2 {
  grid-column: 1;
  margin: 0 0 4px;
  color: var(--text-bold);
  font-size: 18px;
  font-weight: 700;
}

.me-card .me-blurb {
  grid-column: 1 / -1;
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 14px;
}

.me-card .me-thumb {
  grid-column: 2;
  grid-row: 1 / span 4;
  width: 96px;
  height: 96px;
  border-radius: 6px;
  background: var(--bg-darkest);
  object-fit: cover;
}

.me-fields {
  grid-column: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 24px;
  margin: 0;
}

.me-fields > div {
  min-width: 0;
}

.me-fields .me-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-bold);
  margin-bottom: 2px;
}

.me-fields .me-value {
  font-size: 14px;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.me-footer {
  grid-column: 1 / -1;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}

.me-footer .me-footer-title {
  font-weight: 700;
  color: var(--text-bold);
  margin-bottom: 2px;
}

/* ---- status pill ----------------------------------------------- */

.me-status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
}

.me-status--in     { background: #1f7a3a; color: #d1f7da; }
.me-status--wait   { background: #6b5e1f; color: #fff7c2; }
.me-status--host   { background: #1f5a7a; color: #d1ecf7; }
.me-status--none   { background: var(--border); color: var(--text-muted); }

/* ---- actions row ------------------------------------------------ */

.me-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.me-actions form {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
}

.me-actions label {
  color: var(--text-muted);
  font-size: 13px;
}

.me-actions input[type="number"] {
  width: 72px;
}

.me-actions button {
  padding: 6px 14px;
}

.me-actions .me-btn-in     { background: var(--accent); color: #fff; }
.me-actions .me-btn-in:hover     { background: var(--accent-hi); }
.me-actions .me-btn-delay  { background: var(--warn); color: #1e1f22; }
.me-actions .me-btn-delay:hover  { background: var(--warn-hi); }
.me-actions .me-btn-out    { background: var(--danger); color: #fff; }
.me-actions .me-btn-out:hover    { background: var(--danger-hi); }

/* ===================================================================
 * Landing page
 * =================================================================== */

.landing {
  min-height: calc(100vh - 52px - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.landing-card {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 48px 56px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  max-width: 420px;
  width: 100%;
}

.landing-harold {
  display: block;
  width: 160px;
  height: 160px;
  margin: 0 auto 16px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.landing-tag {
  color: var(--text-muted);
  font-size: 15px;
  margin: 0 0 28px;
}

.landing-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: #fff !important;
  padding: 12px 22px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.1s;
}
.landing-button:hover {
  background: var(--accent-hi);
  text-decoration: none;
}

.landing-button svg {
  flex-shrink: 0;
}

/* ===================================================================
 * /me/aliases — self-service alias management
 * =================================================================== */

.alias-section {
  margin: 0 0 24px;
}

.me-blurb-standalone {
  color: var(--text-muted);
  font-size: 13.5px;
  margin: 0 0 14px;
  max-width: 720px;
}

.alias-table {
  border-collapse: collapse;
  width: 100%;
  max-width: 640px;
}

.alias-table thead th {
  background: transparent;
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
}

.alias-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.alias-table tbody tr:hover {
  background: var(--bg-card);
}

.alias-active-badge {
  display: inline-block;
  background: #1f7a3a;
  color: #d1f7da;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.alias-inline-form {
  display: inline-block;
  margin: 0;
}

.alias-set-active-btn {
  font-size: 12px;
  padding: 4px 10px;
}

button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.alias-add-form {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  max-width: 640px;
}

.alias-add-form input[type="text"] {
  flex: 1;
  min-width: 200px;
}
