/* Training Chat — Mars & Co palette, Slack-shaped layout. */

:root {
  --red: #ca3832;
  --red-dark: #a92c27;
  --red-soft: rgba(202, 56, 50, 0.10);
  --ink: #110e0d;
  --ink-2: #1c1817;
  --ink-3: #2a2422;
  --paper: #f8fbf6;
  --white: #ffffff;
  --line: #e3e6e0;
  --text: #221d1b;
  --text-2: #6c6763;
  --text-3: #9a948f;
  --good: #2f7a4f;
  --warn: #b4531f;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(17, 14, 13, .06), 0 8px 24px rgba(17, 14, 13, .07);
  --side-w: 264px;
  --thread-w: 380px;
  --font: "Aeonik Pro", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

/* Panels below set display:flex/grid, which would otherwise beat the UA rule for
   the hidden attribute and leave modals and overlays stuck on screen. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: var(--font);
  color: var(--text);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--red); }

/* ------------------------------------------------------------ shared bits */

.btn {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--text);
  padding: 10px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: #f2f2ef; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn[disabled], .btn-primary[disabled] { opacity: .55; cursor: not-allowed; }

.icon-btn {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  opacity: .75;
  text-decoration: none;
}
.icon-btn:hover { background: rgba(127, 127, 127, .15); opacity: 1; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field > span em { font-weight: 400; color: var(--text-3); font-style: normal; }
.field input, .field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  outline: none;
}
.field input:focus, .field textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.field small { display: block; margin-top: 6px; color: var(--text-3); font-size: 12px; }

.stack .btn { width: 100%; padding: 12px 16px; }
.muted { color: var(--text-2); font-size: 14px; margin-top: -4px; }

.alert { padding: 11px 13px; border-radius: var(--radius); font-size: 14px; margin-bottom: 16px; }
.alert p { margin: 0 0 4px; }
.alert p:last-child { margin-bottom: 0; }
.alert-bad { background: #fdecea; color: #8f2b26; border: 1px solid #f5c9c5; }
.alert-good { background: #e9f4ee; color: #23603f; border: 1px solid #c3e2d0; }

.avatar {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 9px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ------------------------------------------------------------ join screen */

.join-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(140deg, var(--ink) 0%, #2a1a19 55%, #3a1d1b 100%);
}
.join-wrap {
  width: 100%;
  max-width: 880px;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 0;
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .35);
}
.join-brand {
  background: var(--ink);
  color: #f3efec;
  padding: 40px 36px;
}
.join-mark {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--red);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700;
  margin-bottom: 26px;
}
.join-brand h1 { margin: 0 0 6px; font-size: 30px; letter-spacing: -.5px; }
.join-tag { margin: 0 0 28px; color: #b7aeaa; font-size: 15px; }
.join-points { list-style: none; margin: 0; padding: 0; }
.join-points li {
  position: relative;
  padding: 0 0 14px 26px;
  color: #cfc7c3;
  font-size: 14px;
  line-height: 1.5;
}
.join-points li::before {
  content: "";
  position: absolute; left: 4px; top: 7px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red);
}
.join-card { padding: 40px 34px; }
.join-card h2 { margin: 0 0 6px; font-size: 21px; }
.join-card form { margin-top: 22px; }
.join-foot { margin: 22px 0 0; font-size: 13px; text-align: center; }
.join-foot a { color: var(--text-3); text-decoration: none; }
.join-foot a:hover { color: var(--red); }

@media (max-width: 760px) {
  .join-wrap { grid-template-columns: 1fr; max-width: 460px; }
  .join-brand { padding: 28px 26px; }
  .join-points { display: none; }
  .join-brand h1 { font-size: 24px; }
  .join-tag { margin-bottom: 0; }
  .join-card { padding: 28px 26px; }
}

/* ------------------------------------------------------------- app layout */

.app-body { overflow: hidden; }
.app {
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
}
.app.thread-open { grid-template-columns: var(--side-w) minmax(0, 1fr) var(--thread-w); }

/* sidebar */
.sidebar {
  background: var(--ink);
  color: #ddd6d2;
  display: flex;
  flex-direction: column;
  min-height: 0;
  z-index: 30;
}
.side-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.side-mark {
  width: 34px; height: 34px; min-width: 34px;
  border-radius: 9px;
  background: var(--red);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.side-title { display: flex; flex-direction: column; min-width: 0; }
.side-title strong { font-size: 15px; color: #fff; }
.side-title span { font-size: 12px; color: #948b87; }
.side-close { display: none; margin-left: auto; color: #fff; }

.side-scroll { flex: 1; overflow-y: auto; padding: 14px 8px; min-height: 0; }
.side-section { margin-bottom: 22px; }
.side-label {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 8px 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: #877e7a;
  font-weight: 700;
}
.side-label em { font-style: normal; color: #6d6561; }
.side-label .icon-btn { color: #cbc3bf; }

.chan-list, .people-list { list-style: none; margin: 0; padding: 0; }

.chan-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  color: #c9c1bd;
  text-align: left;
  padding: 7px 8px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.3;
}
.chan-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.chan-item.chan-active { background: var(--red); color: #fff; }
.chan-item .hash { opacity: .6; font-weight: 600; }
.chan-item .chan-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chan-item.has-unread .chan-name { font-weight: 700; color: #fff; }
.badge {
  min-width: 19px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  background: rgba(255, 255, 255, .22);
  color: #fff;
}
.badge.mention { background: var(--red); }
.chan-active .badge { background: rgba(255, 255, 255, .28); }
.lock { font-size: 11px; opacity: .6; }

.chan-group {
  padding: 14px 8px 6px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: #6d6561;
  font-weight: 700;
}
.chan-item.chan-archived { color: #8a827e; }
.chan-item.chan-archived .chan-name { font-style: italic; }

.chan-more {
  margin-left: auto;
  padding: 0 2px;
  border-radius: 5px;
  opacity: 0;
  font-size: 15px;
  line-height: 1;
  color: inherit;
}
.chan-item:hover .chan-more { opacity: .7; }
.chan-more:hover { opacity: 1 !important; background: rgba(255, 255, 255, .18); }

.ctx-menu {
  position: fixed;
  z-index: 95;
  min-width: 176px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: var(--shadow);
  padding: 5px;
  overflow: hidden;
}
.ctx-title {
  padding: 7px 10px 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-3);
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}
.ctx-menu button {
  display: block;
  width: 100%;
  border: 0;
  background: none;
  text-align: left;
  padding: 8px 10px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--text);
}
.ctx-menu button:hover { background: #f1f1ed; }
.ctx-menu button.danger { color: var(--red-dark); }
.ctx-menu button.danger:hover { background: #fdecea; }

.person {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  font-size: 13px;
  color: #b8b0ac;
}
.person .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #4caf72;
  min-width: 7px;
}
.person .pname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .pme { color: #7d7571; font-size: 11px; }

.side-me {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}
.side-me-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.side-me-text strong { font-size: 13px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-tag {
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: var(--red);
  color: #fff;
  padding: 1px 6px;
  border-radius: 999px;
  margin-left: 5px;
  vertical-align: 1px;
}
.side-me-text span { font-size: 11px; color: #8d8480; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-me .icon-btn { color: #cbc3bf; }

/* room */
.room {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--paper);
}
.room-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--white);
}
.room-menu { display: none; }
.room-title { flex: 1; min-width: 0; }
.room-title h1 { margin: 0; font-size: 17px; letter-spacing: -.2px; }
.room-title p { margin: 2px 0 0; font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--good);
  background: #e9f4ee;
  padding: 4px 9px;
  border-radius: 999px;
}
.pill.offline { color: var(--warn); background: #fbeee5; }

.stream { flex: 1; overflow-y: auto; min-height: 0; outline: none; }
.stream-inner { padding: 18px 0 10px; }
.loading { padding: 40px 24px; color: var(--text-3); text-align: center; font-size: 14px; }

.load-more { text-align: center; padding: 10px 0 16px; }
.load-more button {
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-2);
}
.load-more button:hover { color: var(--text); }

.day-sep {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 20px 12px;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
}
.day-sep::before, .day-sep::after { content: ""; height: 1px; background: var(--line); flex: 1; }

/* message row */
.msg {
  display: flex;
  gap: 12px;
  padding: 6px 20px;
  position: relative;
}
.msg:hover { background: rgba(17, 14, 13, .028); }
.msg.msg-mention { background: rgba(202, 56, 50, .06); box-shadow: inset 3px 0 0 var(--red); }
.msg-avatar { width: 34px; min-width: 34px; }
.msg-main { flex: 1; min-width: 0; }
.msg-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 1px; }
.msg-name { font-weight: 700; font-size: 14.5px; }
.msg-role { font-size: 11.5px; color: var(--text-3); }
.msg-time { font-size: 11.5px; color: var(--text-3); }
.msg-edited { font-size: 11px; color: var(--text-3); }
.msg-body {
  font-size: 14.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.msg-body code {
  background: #eceee9;
  padding: 1px 5px;
  border-radius: 5px;
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}
.msg-body pre {
  background: #eceee9;
  padding: 10px 12px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 6px 0;
}
.msg-body pre code { background: none; padding: 0; }
.msg-body a { overflow-wrap: anywhere; }
.mention-tag {
  background: var(--red-soft);
  color: var(--red-dark);
  font-weight: 600;
  padding: 0 3px;
  border-radius: 4px;
}
.mention-tag.me { background: var(--red); color: #fff; }

.msg.grouped { padding-top: 1px; }
.msg.grouped .msg-avatar { visibility: hidden; height: 0; }
.msg.grouped .msg-hover-time {
  position: absolute;
  left: 20px;
  top: 4px;
  font-size: 10.5px;
  color: var(--text-3);
  opacity: 0;
  width: 34px;
  text-align: center;
}
.msg.grouped:hover .msg-hover-time { opacity: 1; }
.msg-deleted { color: var(--text-3); font-style: italic; font-size: 13.5px; }

.msg-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 7px; }
.msg-img {
  max-width: 320px;
  max-height: 240px;
  border-radius: 10px;
  border: 1px solid var(--line);
  cursor: zoom-in;
  display: block;
}
.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 10px;
  padding: 8px 12px;
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
  max-width: 280px;
}
.file-chip:hover { border-color: var(--red); }
.file-chip .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.file-chip .fsize { color: var(--text-3); font-size: 11.5px; }

.msg-reacts { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.react {
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 12.5px;
  cursor: pointer;
  line-height: 1.6;
}
.react:hover { border-color: var(--red); }
.react.mine { background: var(--red-soft); border-color: var(--red); color: var(--red-dark); font-weight: 700; }

.thread-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  border: 0;
  background: none;
  color: var(--red);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 0;
}
.thread-link:hover { text-decoration: underline; }

.msg-tools {
  position: absolute;
  right: 18px;
  top: -12px;
  display: none;
  gap: 2px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: var(--shadow);
  padding: 2px;
  z-index: 5;
}
.msg:hover .msg-tools { display: flex; }
.msg-tools button {
  border: 0;
  background: none;
  cursor: pointer;
  padding: 4px 7px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1;
}
.msg-tools button:hover { background: #f0f0ec; }
.msg-tools .tool-text { font-size: 12px; font-weight: 600; color: var(--text-2); }

.emoji-pop {
  position: absolute;
  z-index: 60;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(7, 32px);
  gap: 2px;
}
.emoji-pop button {
  border: 0; background: none; cursor: pointer;
  font-size: 18px; padding: 4px; border-radius: 7px; line-height: 1;
}
.emoji-pop button:hover { background: #f0f0ec; }

.edit-box { margin-top: 6px; }
.edit-box textarea {
  width: 100%;
  border: 1px solid var(--red);
  border-radius: 9px;
  padding: 9px 11px;
  resize: vertical;
  min-height: 62px;
  outline: none;
  font-size: 14.5px;
  line-height: 1.5;
}
.edit-actions { display: flex; gap: 8px; margin-top: 7px; }
.edit-actions .btn { padding: 6px 13px; font-size: 13px; }

/* composer */
.composer {
  border-top: 1px solid var(--line);
  background: var(--white);
  padding: 12px 20px 14px;
}
.composer-row { display: flex; align-items: flex-end; gap: 8px; }
.composer-input { flex: 1; position: relative; min-width: 0; }
.composer textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 13px;
  resize: none;
  max-height: 180px;
  outline: none;
  font-size: 14.5px;
  line-height: 1.5;
  background: var(--white);
}
.composer textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.attach-btn { width: 38px; height: 40px; font-size: 17px; cursor: pointer; }
.send-btn { height: 40px; padding: 0 18px; }
.composer-note { margin: 7px 0 0; font-size: 12px; color: var(--text-3); min-height: 15px; }
.composer-note.bad { color: var(--red-dark); }

.attach-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 9px; }
.attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f1f2ee;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12.5px;
}
.attach-chip button { border: 0; background: none; cursor: pointer; color: var(--text-3); font-size: 15px; line-height: 1; }
.attach-chip button:hover { color: var(--red); }

.mention-pop {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 50;
}
.mention-pop button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  border: 0;
  background: none;
  text-align: left;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
}
.mention-pop button:hover, .mention-pop button.active { background: var(--red-soft); }
.mention-pop .mrole { color: var(--text-3); font-size: 12px; }

/* thread pane */
.thread-pane {
  border-left: 1px solid var(--line);
  background: var(--white);
  display: flex;
  flex-direction: column;
  min-height: 0;
  z-index: 25;
}
.thread-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.thread-scroll { flex: 1; overflow-y: auto; padding: 14px 0; min-height: 0; }
.thread-scroll .msg { padding-left: 16px; padding-right: 16px; }
.thread-root { border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 6px; }
.thread-count { padding: 6px 16px 10px; font-size: 12px; color: var(--text-3); font-weight: 600; }
.thread-composer { padding: 12px 16px 14px; }

/* overlays */
.scrim { position: fixed; inset: 0; background: rgba(17, 14, 13, .45); z-index: 28; }

.modal {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(17, 14, 13, .45);
  z-index: 70;
  padding: 20px;
}
.modal-card {
  background: var(--white);
  border-radius: 14px;
  padding: 26px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, .3);
}
.modal-card h2 { margin: 0 0 18px; font-size: 19px; }
.modal-actions { display: flex; gap: 9px; justify-content: flex-end; margin-top: 20px; }
.modal-error { color: var(--red-dark); font-size: 13px; margin: 0; }

.lightbox {
  position: fixed; inset: 0;
  background: rgba(17, 14, 13, .88);
  display: flex; align-items: center; justify-content: center;
  z-index: 80;
  padding: 30px;
  cursor: zoom-out;
}
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }

.toast-wrap {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13.5px;
  box-shadow: var(--shadow);
}
.toast.bad { background: var(--red-dark); }

/* ------------------------------------------------------------- responsive */

@media (max-width: 1080px) {
  .app.thread-open { grid-template-columns: var(--side-w) minmax(0, 1fr); }
  .thread-pane {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: min(420px, 100%);
    box-shadow: -12px 0 40px rgba(0, 0, 0, .18);
  }
}

@media (max-width: 820px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .app.thread-open { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed;
    top: 0; bottom: 0; left: 0;
    width: 280px;
    transform: translateX(-102%);
    transition: transform .2s ease;
  }
  .app.side-open .sidebar { transform: translateX(0); }
  .side-close { display: inline-flex; }
  .room-menu { display: inline-flex; }
  .msg { padding-left: 14px; padding-right: 14px; }
  .composer { padding: 10px 14px 12px; }
  .room-head { padding: 11px 14px; }
  .msg-img { max-width: 100%; }
}

/* ----------------------------------------------------------- admin screens */

.admin-body { background: var(--paper); overflow: auto; }
.admin-shell { max-width: 1040px; margin: 0 auto; padding: 28px 22px 60px; }
.admin-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-bottom: 22px; flex-wrap: wrap;
}
.admin-top h1 { margin: 0; font-size: 22px; }
.admin-top .sub { color: var(--text-2); font-size: 13px; margin: 4px 0 0; }
.admin-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.admin-nav a {
  padding: 8px 14px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
  border: 1px solid var(--line);
  background: var(--white);
}
.admin-nav a.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 22px;
  margin-bottom: 18px;
}
.card h2 { margin: 0 0 4px; font-size: 16px; }
.card .card-note { margin: 0 0 16px; color: var(--text-2); font-size: 13px; }

.stat-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.stat {
  flex: 1;
  min-width: 130px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
}
.stat b { display: block; font-size: 24px; letter-spacing: -.5px; }
.stat span { font-size: 12px; color: var(--text-2); }

table.grid { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.grid th, table.grid td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.grid th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
table.grid tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
.tiny-btn {
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 7px;
  padding: 4px 9px;
  font-size: 12px;
  cursor: pointer;
}
.tiny-btn:hover { border-color: var(--red); color: var(--red-dark); }

.danger { border-color: #f0c7c3; background: #fffaf9; }
.danger h2 { color: var(--red-dark); }
.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { margin-bottom: 0; flex: 1; min-width: 160px; }

.login-wrap { max-width: 380px; margin: 12vh auto; padding: 0 20px; }
.login-card { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 30px 28px; }
.login-card h1 { margin: 0 0 6px; font-size: 20px; }
