/* ── Admin backend — denser, more utility-shaped than the landing page ── */

.admin-body {
  background: #050b1a;
}

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

/* Top bar */
.admin-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(5, 11, 26, 0.85);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}
.admin-bar .left {
  display: flex; align-items: center; gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}
.admin-bar .right {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.admin-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ice);
  padding: 5px 10px; border-radius: 999px;
  background: rgba(125, 211, 252, 0.10);
  border: 1px solid var(--border-2);
}
.admin-bar h1 {
  font-size: 1.1rem;
  font-family: 'Space Grotesk';
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Top tabs */
.admin-tabs {
  display: flex; gap: 4px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  min-width: 0;
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tabs button {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--text-dim);
  padding: 8px 14px;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}
.admin-tabs button:hover { color: var(--text); }
.admin-tabs button.on {
  background: var(--surface-2);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
.admin-tabs button .count {
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(125, 211, 252, 0.15);
  color: var(--ice);
  font-weight: 600;
}

/* Mid-width: hide tab text labels, leave icons + badges */
@media (max-width: 1100px) {
  .admin-tabs button .tab-label { display: none; }
  .admin-tabs button { padding: 9px 11px; }
}
@media (max-width: 700px) {
  .admin-tabs { padding: 3px; }
  .admin-tabs button { padding: 8px 10px; font-size: 0.78rem; }
}
.admin-bar .right { display: flex; align-items: center; gap: 10px; }
.admin-bar .who {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-right: 4px;
}
.admin-bar .who b { color: var(--text); font-weight: 600; }

@media (max-width: 1100px) {
  /* Hide name text and Site button label, keep role pill */
  .admin-bar .who b { display: none; }
  .admin-bar .who { gap: 0; }
  .admin-bar .who::before { content: ""; }
}
@media (max-width: 900px) {
  /* Hide entire who block at narrower widths, keep logout */
  .admin-bar .who { display: none; }
  .admin-bar { padding: 12px 16px; }
  .admin-bar .admin-tag { display: none; }
}
@media (max-width: 640px) {
  .admin-bar .left > a.btn { padding: 8px; }
  .admin-bar .left > a.btn span { display: none; }
}

/* Layout */
.admin-page {
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  padding: 32px 28px 80px;
}
@media (max-width: 900px) {
  .admin-page { padding: 20px 16px 60px; }
}

.admin-main {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .admin-main { grid-template-columns: 1fr; }
}

/* Sidebar — list of NAPs */
.admin-sidebar {
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 100px);
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
@media (max-width: 900px) {
  .admin-sidebar { position: static; max-height: none; }
}

.sb-head {
  padding: 16px 18px;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--border);
}
.sb-head h2 {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0;
  font-family: 'Inter';
}
.sb-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}
.sb-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 12px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: background .12s, border-color .12s;
  margin-bottom: 2px;
}
.sb-item:hover { background: var(--surface); border-color: var(--border); }
.sb-item.active { background: var(--surface-2); border-color: var(--border-2); }
.sb-item .mark {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(125, 211, 252, 0.25), rgba(125, 211, 252, 0.05));
  border: 1px solid var(--border-2);
  display: grid; place-items: center;
  font-family: 'Space Grotesk';
  font-weight: 700;
  font-size: 0.72rem;
  color: var(--ice);
  flex-shrink: 0;
}
.sb-item .body { flex: 1; min-width: 0; }
.sb-item .nm {
  font-size: 0.92rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sb-item .sub {
  font-size: 0.76rem; color: var(--text-faint); margin-top: 2px;
}
.sb-item .pill {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid var(--border-2);
}
.sb-item .pill.active  { color: #5eead4; border-color: rgba(94, 234, 212, 0.35); background: rgba(94, 234, 212, 0.08); }
.sb-item .pill.pending { color: #fbbf24; border-color: rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.08); }
.sb-item .pill.expired { color: #f87171; border-color: rgba(248, 113, 113, 0.35); background: rgba(248, 113, 113, 0.08); }

.sb-foot {
  padding: 12px;
  border-top: 1px solid var(--border);
}

/* Content panel */
.admin-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  min-height: 60vh;
}

.empty {
  padding: 80px 40px;
  text-align: center;
  color: var(--text-dim);
}
.empty h3 { font-family: 'Space Grotesk'; font-size: 1.3rem; margin-bottom: 8px; color: var(--text); }
.empty p { max-width: 400px; margin: 0 auto; }

.panel-head {
  padding: 24px 28px;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 20px;
}
.panel-head .titlewrap {
  display: flex; gap: 16px; align-items: center;
  min-width: 0; flex: 1;
}
.panel-head .mark {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(125, 211, 252, 0.30), rgba(125, 211, 252, 0.05));
  border: 1px solid var(--border-2);
  display: grid; place-items: center;
  font-family: 'Space Grotesk';
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ice);
  flex-shrink: 0;
}
.panel-head h2 {
  font-size: 1.4rem;
  margin: 0;
  letter-spacing: -0.02em;
}
.panel-head .sub {
  display: flex; gap: 16px; flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 4px;
}
.panel-head .sub b { color: var(--text); font-weight: 600; font-family: 'Space Grotesk'; }
.panel-head .actions { display: flex; gap: 8px; flex-shrink: 0; }

@media (max-width: 640px) {
  .panel-head { padding: 18px 18px; flex-direction: column; }
  .panel-head h2 { font-size: 1.2rem; }
}

.panel-body { padding: 24px 28px; }
@media (max-width: 640px) { .panel-body { padding: 18px; } }

.panel-section {
  margin-bottom: 32px;
}
.panel-section:last-child { margin-bottom: 0; }

.panel-section h3 {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 14px;
  display: flex; justify-content: space-between; align-items: center;
  font-family: 'Inter';
}
.panel-section-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.panel-section-head h3 { margin: 0; }

/* Form */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 640px) {
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 0.78rem; font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}
.field input,
.field select,
.field textarea {
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border-2);
  border-radius: 9px;
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  outline: none;
  transition: border-color .15s, background .15s;
  font-family: inherit;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--ice);
  box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.15);
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-faint); }
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%237dd3fc' d='M0 0h12L6 8z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.field textarea { min-height: 70px; resize: vertical; }

/* Events table — fixed event slots */
.evt-tbl {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.18);
}
.evt-row {
  display: grid;
  grid-template-columns: 160px 110px 130px 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.evt-row:last-child { border-bottom: 0; }
.evt-row.head {
  background: rgba(0, 0, 0, 0.3);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 10px 14px;
}
.evt-row .evt-label {
  display: flex; flex-direction: column; gap: 2px;
}
.evt-row .evt-label .nm {
  font-family: 'Space Grotesk';
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}
.evt-row .evt-label .sh {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: var(--ice);
}
.evt-row .preview {
  font-size: 0.78rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.evt-row .preview small { color: var(--text-faint); display: block; font-size: 0.68rem; letter-spacing: 0.1em; margin-top: 2px; }
.evt-row input,
.evt-row select {
  padding: 8px 10px;
  font-size: 0.86rem;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  outline: none;
  width: 100%;
  min-width: 0;
}
.evt-row input:focus, .evt-row select:focus {
  border-color: var(--ice);
  box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.15);
}
.evt-row select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%237dd3fc' d='M0 0h10L5 6z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 22px;
}
.evt-row .delbtn {
  width: 30px; height: 30px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  cursor: pointer;
  display: grid; place-items: center;
  transition: all .15s;
}
.evt-row .delbtn:hover { color: #f87171; border-color: rgba(248, 113, 113, 0.4); background: rgba(248, 113, 113, 0.08); }

@media (max-width: 900px) {
  .evt-row.head { display: none; }
  .evt-row {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .evt-row .evt-label { grid-column: 1 / -1; }
}

/* ── Transfer requests ── */
.req-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.req-toolbar .filters {
  display: flex; gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 3px; border-radius: 999px;
}
.req-toolbar .filters button {
  appearance: none; background: transparent; border: 0;
  color: var(--text-dim); padding: 7px 14px;
  font: inherit; font-size: 0.82rem; font-weight: 500;
  border-radius: 999px; cursor: pointer;
}
.req-toolbar .filters button:hover { color: var(--text); }
.req-toolbar .filters button.on {
  background: var(--surface-2);
  color: var(--text);
}

.req-tbl {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  overflow: hidden;
}
.req-grid {
  overflow-x: auto;
}
.req-row {
  display: grid;
  grid-template-columns: 1fr 110px 100px 130px 110px 1fr 130px;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  min-width: 1000px;
}
.req-row.head {
  background: rgba(0, 0, 0, 0.28);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 14px 18px;
}
.req-row:last-child { border-bottom: 0; }
.req-row:hover:not(.head) { background: rgba(125, 211, 252, 0.03); }

.req-ign {
  font-family: 'Space Grotesk';
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
  color: var(--text);
}
.req-ign small {
  display: block;
  font-family: 'Inter';
  font-size: 0.74rem;
  color: var(--text-faint);
  margin-top: 2px;
  font-weight: 500;
  letter-spacing: 0;
}
.req-cell {
  font-size: 0.88rem;
  color: var(--text-dim);
}
.req-cell b { color: var(--text); font-weight: 600; font-family: 'Space Grotesk'; }
.req-notes {
  font-size: 0.84rem;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}
.req-notes:empty::before {
  content: "—";
  color: var(--text-faint);
}
.req-actions {
  display: flex; gap: 6px;
  justify-content: flex-end;
}
.req-actions button {
  appearance: none;
  padding: 6px 12px;
  border-radius: 8px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid;
}
.req-actions .approve {
  background: rgba(94, 234, 212, 0.10);
  border-color: rgba(94, 234, 212, 0.35);
  color: #5eead4;
}
.req-actions .approve:hover { background: rgba(94, 234, 212, 0.18); }
.req-actions .deny {
  background: transparent;
  border-color: rgba(248, 113, 113, 0.35);
  color: #f87171;
}
.req-actions .deny:hover { background: rgba(248, 113, 113, 0.10); }
.req-actions .delete {
  background: transparent;
  border-color: var(--border-2);
  color: var(--text-faint);
  padding: 6px;
}
.req-actions .delete:hover { color: #f87171; border-color: rgba(248, 113, 113, 0.4); }

.req-status {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--border-2);
  white-space: nowrap;
}
.req-status.pending  { color: #fbbf24; border-color: rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.08); }
.req-status.approved { color: #5eead4; border-color: rgba(94, 234, 212, 0.35); background: rgba(94, 234, 212, 0.08); }
.req-status.denied   { color: #f87171; border-color: rgba(248, 113, 113, 0.35); background: rgba(248, 113, 113, 0.08); }

.req-empty {
  padding: 60px 30px;
  text-align: center;
  color: var(--text-faint);
}
.req-empty h3 {
  font-family: 'Space Grotesk';
  color: var(--text);
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.add-evt {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface);
  border: 1px dashed var(--border-2);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 9px;
  cursor: pointer;
  font: inherit;
  font-size: 0.86rem;
  margin-top: 12px;
  transition: all .15s;
}
.add-evt:hover { background: var(--surface-2); border-style: solid; border-color: var(--ice); color: var(--ice); }

/* Footer actions */
.panel-foot {
  padding: 18px 28px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.panel-foot .danger {
  background: transparent;
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: #f87171;
  padding: 9px 14px;
  border-radius: 999px;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.panel-foot .danger:hover { background: rgba(248, 113, 113, 0.08); border-color: rgba(248, 113, 113, 0.5); }
.panel-foot .save-row { display: flex; gap: 10px; align-items: center; }
.panel-foot .saved {
  font-size: 0.82rem;
  color: #5eead4;
  display: flex; align-items: center; gap: 6px;
  opacity: 0; transition: opacity .25s;
}
.panel-foot .saved.shown { opacity: 1; }

@media (max-width: 640px) { .panel-foot { padding: 14px 18px; } }

/* Stat strip on top */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
@media (max-width: 700px) { .stat-strip { grid-template-columns: 1fr 1fr; } }
.strip-card {
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.strip-card .lbl {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 600;
}
.strip-card .val {
  font-family: 'Space Grotesk';
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1;
  margin-top: 8px;
}

/* Confirm dialog */
.confirm-bg {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(2, 6, 18, 0.7);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: grid; place-items: center;
  padding: 20px;
}
.confirm-box {
  max-width: 400px;
  padding: 28px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: 16px;
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
}
.confirm-box h3 { font-size: 1.2rem; font-family: 'Space Grotesk'; margin-bottom: 8px; }
.confirm-box p { color: var(--text-dim); margin-bottom: 22px; font-size: 0.92rem; }
.confirm-box .row { display: flex; gap: 10px; justify-content: flex-end; }

/* ============================================================
   4wos ATS — full styles for Applications · Alliances · Events ·
   Content · Users views (expanded).
   ============================================================ */

/* Apps list toolbar + filters + search */
.apps-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 14px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.apps-toolbar .filters {
  display: flex; gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 3px; border-radius: 999px;
  flex-wrap: wrap;
}
.apps-toolbar .filters button {
  appearance: none; background: transparent; border: 0;
  color: var(--text-dim); padding: 7px 12px;
  font: inherit; font-size: 0.82rem; font-weight: 500;
  border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.apps-toolbar .filters button:hover { color: var(--text); }
.apps-toolbar .filters button.on {
  background: var(--surface-2);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
.apps-toolbar .filters .ct {
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(125, 211, 252, 0.12);
  color: var(--ice);
  font-weight: 600;
}

.search-wrap {
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 999px;
  color: var(--text-faint);
  min-width: 280px;
  flex: 1; max-width: 360px;
}
.search-wrap input {
  flex: 1;
  background: transparent;
  border: 0;
  padding: 10px 0;
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  outline: none;
}
.search-wrap input::placeholder { color: var(--text-faint); }
@media (max-width: 700px) {
  .search-wrap { min-width: 100%; max-width: none; }
}

/* Apps table */
.apps-tbl {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  overflow: hidden;
}
.apps-scroll { overflow-x: auto; }
.apps-row {
  display: grid;
  grid-template-columns: 120px 1.4fr 80px 90px 90px 1.2fr 110px 110px;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  min-width: 1100px;
  cursor: pointer;
  transition: background .12s;
}
.apps-row:last-child { border-bottom: 0; }
.apps-row:not(.head):hover { background: rgba(125, 211, 252, 0.04); }
.apps-row.head {
  background: rgba(0, 0, 0, 0.28);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  cursor: default;
}
.apps-row.head > div[role="button"] { cursor: pointer; user-select: none; }
.apps-row.head > div[role="button"]:hover { color: var(--text); }

.apps-cell {
  font-size: 0.88rem;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.apps-cell b { color: var(--text); font-weight: 600; font-family: 'Space Grotesk'; }
.apps-cell small {
  display: block;
  font-size: 0.74rem;
  color: var(--text-faint);
  margin-top: 2px;
  font-weight: 500;
  letter-spacing: 0;
}
.apps-name {
  font-family: 'Space Grotesk';
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
  color: var(--text);
}
.apps-name small { font-family: 'Inter'; font-weight: 500; }
.apps-date {
  font-family: 'Space Grotesk';
  font-weight: 500;
  color: var(--text);
}

.apps-actions {
  display: flex; justify-content: flex-end; gap: 6px;
}
.view-btn { white-space: nowrap; }

.apps-empty {
  padding: 60px 30px;
  text-align: center;
  color: var(--text-faint);
}
.apps-empty h3 {
  font-family: 'Space Grotesk';
  color: var(--text);
  font-size: 1.1rem;
  margin-bottom: 6px;
}

/* Status pill */
.app-status {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--border-2);
  white-space: nowrap;
}
.app-status.pending   { color: #fbbf24; border-color: rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.08); }
.app-status.approved  { color: #5eead4; border-color: rgba(94, 234, 212, 0.35); background: rgba(94, 234, 212, 0.08); }
.app-status.rejected  { color: #f87171; border-color: rgba(248, 113, 113, 0.35); background: rgba(248, 113, 113, 0.08); }
.app-status.withdrawn { color: var(--text-faint); border-color: var(--border-2); background: var(--surface); }

/* Detail view */
.detail-back-row {
  display: flex; gap: 10px; align-items: center;
  margin-bottom: 18px;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 18px;
  align-items: start;
}
@media (max-width: 1100px) { .detail-grid { grid-template-columns: 1fr; } }

.detail-side {
  display: flex; flex-direction: column; gap: 14px;
}
.side-card { min-height: auto; }
.side-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.side-body { padding: 18px 20px; }

.status-stack { display: grid; gap: 8px; }
.status-opt {
  appearance: none;
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-dim);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all .15s;
}
.status-opt:hover { background: rgba(255, 255, 255, 0.04); border-color: var(--border-2); }
.status-opt.pending.on   { background: rgba(251, 191, 36, 0.12); border-color: rgba(251, 191, 36, 0.4); color: #fbbf24; }
.status-opt.approved.on  { background: rgba(94, 234, 212, 0.12); border-color: rgba(94, 234, 212, 0.4); color: #5eead4; }
.status-opt.rejected.on  { background: rgba(248, 113, 113, 0.12); border-color: rgba(248, 113, 113, 0.4); color: #f87171; }
.status-opt.withdrawn.on { background: var(--surface-2); border-color: var(--border-2); color: var(--text-dim); }

.status-meta {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: grid; gap: 8px;
  font-size: 0.84rem;
}
.status-meta > div { display: flex; justify-content: space-between; gap: 14px; }
.status-meta span { color: var(--text-faint); }
.status-meta b { color: var(--text); font-weight: 500; font-family: 'Space Grotesk'; }

/* Notes thread */
.notes-thread {
  display: flex; flex-direction: column; gap: 12px;
  max-height: 280px;
  overflow-y: auto;
  padding: 4px 0;
  margin-bottom: 14px;
}
.note-row {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.note-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px;
  gap: 10px;
}
.note-author {
  font-family: 'Space Grotesk';
  font-weight: 600;
  font-size: 0.84rem;
  color: var(--ice);
}
.note-when { font-size: 0.74rem; color: var(--text-faint); }
.note-body {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.5;
  white-space: pre-wrap;
}

.note-form { display: flex; flex-direction: column; gap: 10px; }
.note-form textarea {
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border-2);
  border-radius: 9px;
  color: var(--text);
  font: inherit;
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
  resize: vertical;
  min-height: 70px;
}
.note-form textarea:focus { border-color: var(--ice); box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.15); }
.note-form button { align-self: flex-end; }
.note-form button:disabled { opacity: 0.5; cursor: not-allowed; }

/* Activity log */
.panel-toggle {
  appearance: none;
  background: transparent;
  border: 0;
  display: flex; align-items: center; gap: 10px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0;
  margin-bottom: 14px;
}
.panel-toggle:hover { color: var(--text); }

.activity-list { display: flex; flex-direction: column; gap: 0; }
.activity-row {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.activity-row:last-child { border-bottom: 0; }
.activity-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-top: 6px;
  background: var(--text-faint);
  border: 1px solid var(--border-2);
}
.activity-dot[data-action="created"]        { background: #5eead4; }
.activity-dot[data-action="status_changed"] { background: #fbbf24; }
.activity-dot[data-action="note_added"]     { background: var(--ice); }
.activity-dot[data-action="updated"]        { background: var(--text-faint); }

.activity-h { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.activity-action {
  font-family: 'Space Grotesk';
  font-weight: 600;
  font-size: 0.84rem;
  color: var(--text);
  text-transform: capitalize;
}
.activity-user, .activity-when { font-size: 0.74rem; color: var(--text-faint); }
.activity-details {
  margin-top: 4px;
  font-size: 0.83rem;
  color: var(--text-dim);
  line-height: 1.45;
}

/* KV display */
.detail-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 28px;
}
@media (max-width: 600px) { .detail-grid-2 { grid-template-columns: 1fr; } }
.kv { display: flex; flex-direction: column; gap: 2px; }
.kv-lbl {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 600;
}
.kv-v {
  font-size: 0.92rem;
  color: var(--text);
  font-weight: 500;
}

.addp-list { display: flex; flex-direction: column; gap: 12px; }
.addp-grid {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}
.addp-grid-h {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 10px;
}
.addp-grid-h b { color: var(--text); font-weight: 600; font-family: 'Space Grotesk'; }
.addp-grid-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
@media (max-width: 700px) { .addp-grid-row { grid-template-columns: 1fr 1fr; } }

/* Role pills */
.role-pill {
  display: inline-flex; align-items: center;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-2);
  white-space: nowrap;
  background: var(--surface);
}
.role-pill.super_admin    { color: #c4b5fd; border-color: rgba(196, 181, 253, 0.4); background: rgba(196, 181, 253, 0.08); }
.role-pill.admin          { color: var(--ice); border-color: rgba(125, 211, 252, 0.4); background: rgba(125, 211, 252, 0.10); }
.role-pill.alliance_admin { color: #5eead4; border-color: rgba(94, 234, 212, 0.35); background: rgba(94, 234, 212, 0.08); }
.role-pill.web_admin      { color: #fbbf24; border-color: rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.08); }
.role-pill.staff          { color: var(--text-dim); }

/* Users table */
.users-row {
  display: grid;
  grid-template-columns: 1.2fr 1.5fr 130px 110px 110px 130px;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  min-width: 900px;
}
.users-row.head {
  background: rgba(0, 0, 0, 0.28);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.admin-bar .who { display: inline-flex; align-items: center; gap: 8px; }

/* Alliances grid */
.ally-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (max-width: 900px) { .ally-grid { grid-template-columns: 1fr; } }

.ally-card {
  padding: 22px;
  display: flex; flex-direction: column; gap: 14px;
}
.ally-head {
  display: flex; gap: 14px; align-items: flex-start;
}
.ally-mark {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(125, 211, 252, 0.30), rgba(125, 211, 252, 0.05));
  border: 1px solid var(--border-2);
  display: grid; place-items: center;
  font-family: 'Space Grotesk';
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--ice);
  flex-shrink: 0;
}
.ally-info { flex: 1; min-width: 0; }
.ally-info h3 {
  font-family: 'Space Grotesk';
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.ally-meta {
  display: flex; gap: 12px; flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--text-dim);
  align-items: center;
}
.ally-desc {
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.5;
  text-wrap: pretty;
  margin: 0;
}
.ally-foot {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.ally-count {
  font-size: 0.82rem;
  color: var(--text-faint);
}
.ally-actions {
  display: flex; gap: 6px;
}

.rec-pill {
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-2);
}
.rec-pill.on  { color: #5eead4; border-color: rgba(94, 234, 212, 0.35); background: rgba(94, 234, 212, 0.08); }
.rec-pill.off { color: var(--text-faint); background: var(--surface); }

/* Danger icon button */
.btn-icon-danger {
  appearance: none;
  width: 32px; height: 32px;
  background: transparent;
  border: 1px solid var(--border-2);
  border-radius: 8px;
  color: var(--text-faint);
  cursor: pointer;
  display: grid; place-items: center;
  transition: all .15s;
}
.btn-icon-danger:hover { color: #f87171; border-color: rgba(248, 113, 113, 0.4); background: rgba(248, 113, 113, 0.08); }

/* Confirm danger */
.btn-danger {
  background: linear-gradient(180deg, #fca5a5 0%, #ef4444 100%) !important;
  color: #fff !important;
}

/* Schedule mini-table */
.sched-mini-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.4fr) 90px 80px 90px 80px 38px 38px;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.18);
  min-width: 620px;
}
.sched-mini-row:last-child { border-bottom: 0; }
.sched-mini-row.head {
  background: rgba(0, 0, 0, 0.3);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.sched-mini-evt {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ally-tag-mini {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(125, 211, 252, 0.30), rgba(125, 211, 252, 0.05));
  border: 1px solid var(--border-2);
  display: grid; place-items: center;
  font-family: 'Space Grotesk';
  font-weight: 700;
  font-size: 0.65rem;
  color: var(--ice);
  flex-shrink: 0;
}

.vote-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--ice);
  background: rgba(125, 211, 252, 0.10);
  border: 1px solid var(--border-2);
  white-space: nowrap;
}

/* Schedule editor modal — wider than default for the table */
.modal.sched-editor {
  max-width: 820px;
}
.sched-mini-wrap {
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.18);
}
.sched-mini-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.sched-mini-wrap .sched-mini-row {
  border-bottom-color: var(--border);
}
.sched-mini-wrap .sched-mini-row:last-child {
  border-bottom: 0;
}

/* Editing-row highlight */
.sched-mini-row.editing {
  background: rgba(125, 211, 252, 0.08);
  outline: 1px solid var(--border-2);
  outline-offset: -1px;
}

@media (max-width: 700px) {
  .sched-mini-row {
    grid-template-columns: 1.5fr 80px 80px;
    row-gap: 8px;
  }
  .sched-mini-row.head { display: none; }
}

/* Info banner */
.info-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  background: rgba(125, 211, 252, 0.08);
  border: 1px solid rgba(125, 211, 252, 0.25);
  border-radius: 12px;
  color: var(--text);
  font-size: 0.88rem;
  margin-bottom: 16px;
}
.info-banner b { color: var(--ice); font-weight: 600; }

/* Events list */
.event-list { display: flex; flex-direction: column; gap: 12px; }
.event-card { overflow: hidden; }
.event-row {
  display: flex; align-items: center; gap: 16px;
  width: 100%;
  padding: 18px 22px;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: background .15s;
}
.event-row:hover { background: rgba(125, 211, 252, 0.04); }
.event-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(125, 211, 252, 0.25), rgba(125, 211, 252, 0.05));
  border: 1px solid var(--border-2);
  display: grid; place-items: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.event-info { flex: 1; min-width: 0; }
.event-info h3 {
  font-family: 'Space Grotesk';
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}
.event-meta {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--text-dim);
}
.event-type {
  font-family: 'Space Grotesk';
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ice);
}
.event-pill {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(125, 211, 252, 0.08);
  border: 1px solid var(--border-2);
  color: var(--ice);
  font-weight: 600;
}
.event-count { font-size: 0.78rem; color: var(--text-faint); }

.event-expanded {
  padding: 0 22px 22px;
  border-top: 1px solid var(--border);
}
.event-desc {
  font-size: 0.92rem;
  color: var(--text-dim);
  line-height: 1.5;
  margin: 18px 0;
  text-wrap: pretty;
}
.event-subs {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.event-subtype {
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  color: var(--text-dim);
}
.event-schedules .evt-tbl { margin: 0; }
.event-empty {
  padding: 20px;
  text-align: center;
  color: var(--text-faint);
  font-size: 0.86rem;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 12px;
  border: 1px dashed var(--border-2);
}
.event-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* Content tabs */
.content-tabs {
  display: inline-flex; gap: 4px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 16px;
}
.content-tabs button {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--text-dim);
  padding: 9px 14px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
}
.content-tabs button:hover { color: var(--text); }
.content-tabs button.on {
  background: var(--surface-2);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}

.pages-row {
  display: grid;
  grid-template-columns: 180px 1.5fr 110px 110px 110px 130px;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  min-width: 900px;
}
.pages-row.head {
  background: rgba(0, 0, 0, 0.28);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.slug-code {
  font-family: 'Space Grotesk', monospace;
  font-size: 0.82rem;
  color: var(--ice);
  background: rgba(125, 211, 252, 0.10);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-2);
}

.pub-pill {
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-2);
}
.pub-pill.on  { color: #5eead4; border-color: rgba(94, 234, 212, 0.35); background: rgba(94, 234, 212, 0.08); }
.pub-pill.off { color: var(--text-faint); background: var(--surface); }

.faq-row {
  display: grid;
  grid-template-columns: 100px 1.5fr 110px 120px 130px;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  min-width: 800px;
}
.faq-row.head {
  background: rgba(0, 0, 0, 0.28);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.faq-order {
  display: flex; align-items: center; gap: 6px;
  font-family: 'Space Grotesk';
  font-weight: 700;
  color: var(--ice);
  font-size: 0.95rem;
}
.faq-move {
  appearance: none;
  width: 22px; height: 22px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 6px;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1;
}
.faq-move:hover { color: var(--text); background: var(--surface-2); }
.faq-move:disabled { opacity: 0.3; cursor: not-allowed; }

/* Language tabs (in editors) */
.lang-tabs {
  display: flex; flex-wrap: wrap; gap: 4px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.lang-tabs button {
  appearance: none;
  background: transparent;
  border: 0;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 11px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dim);
  border-radius: 8px;
  cursor: pointer;
  letter-spacing: 0.04em;
}
.lang-tabs button:hover { color: var(--text); }
.lang-tabs button.on {
  background: var(--surface-2);
  color: var(--text);
}
.lang-tabs button .lang-flag { font-size: 0.9rem; }
.lang-tabs .req { color: var(--ice); margin-left: 2px; }

/* ── Alliance banner editor ── */
.banner-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 22px;
  padding: 18px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--border);
  border-radius: 14px;
}
@media (max-width: 700px) {
  .banner-row { grid-template-columns: 1fr; }
}

.banner-preview {
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 14px;
  position: relative;
  display: grid; place-items: center;
  overflow: hidden;
  box-shadow: inset 0 -50px 80px -20px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-2);
}
.banner-preview img {
  width: 70%; height: 70%;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}
.banner-badge {
  font-size: 5rem;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
  line-height: 1;
}
.banner-tag {
  position: absolute;
  left: 12px; right: 12px; bottom: 10px;
  text-align: center;
  font-family: 'Space Grotesk';
  font-weight: 700;
  letter-spacing: 0.18em;
  font-size: 0.95rem;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  text-transform: uppercase;
}

.banner-controls {
  display: flex; flex-direction: column; gap: 14px;
}

.color-swatches {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.color-swatch {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  outline: 2px solid var(--border);
  outline-offset: -1px;
  transition: transform .12s, outline-color .12s;
}
.color-swatch:hover { transform: scale(1.1); }
.color-swatch.on {
  outline-color: var(--text);
  outline-width: 2px;
  border-color: var(--bg-0);
  transform: scale(1.15);
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
@media (max-width: 480px) { .badge-grid { grid-template-columns: repeat(3, 1fr); } }
.badge-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 6px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border-2);
  border-radius: 9px;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  transition: all .12s;
}
.badge-btn:hover { border-color: var(--ice); background: rgba(125, 211, 252, 0.06); }
.badge-btn.on {
  border-color: var(--ice);
  background: rgba(125, 211, 252, 0.12);
  box-shadow: 0 0 0 2px rgba(125, 211, 252, 0.2);
}
.badge-ico { font-size: 1.3rem; line-height: 1; }
.badge-name {
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 600;
}

.logo-uploader {
  display: flex; align-items: center; gap: 8px;
}

/* ── SVS view ── */
.svs-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 18px;
  align-items: start;
}
@media (max-width: 980px) { .svs-grid { grid-template-columns: 1fr; } }

.svs-side .side-head {
  display: flex; align-items: center; justify-content: space-between;
}
.svs-side .side-head .infotip { margin-left: auto; }

.svs-list {
  display: flex; flex-direction: column; gap: 14px;
}
.svs-card {
  padding: 22px;
}
.svs-card-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.svs-vs {
  font-family: 'Space Grotesk';
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}
.svs-vs b { color: var(--ice); font-weight: 600; }
.svs-date {
  font-size: 0.78rem;
  color: var(--text-faint);
  margin-top: 2px;
}
.svs-result {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.svs-pill {
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-2);
}
.svs-pill.ok  { color: #5eead4; border-color: rgba(94, 234, 212, 0.35); background: rgba(94, 234, 212, 0.08); }
.svs-pill.bad { color: #f87171; border-color: rgba(248, 113, 113, 0.35); background: rgba(248, 113, 113, 0.08); }

.svs-president {
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(251, 191, 36, 0.02));
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.92rem;
  margin-bottom: 12px;
}
.svs-president b {
  font-family: 'Space Grotesk';
  font-weight: 600;
  color: #fbbf24;
}

.svs-rankings {
  background: rgba(0, 0, 0, 0.20);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
}
.svs-rank-head {
  padding: 10px 14px;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-faint);
  background: rgba(0, 0, 0, 0.18);
  border-bottom: 1px solid var(--border);
}
.svs-rank-row {
  display: grid;
  grid-template-columns: 36px 40px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}
.svs-rank-row:last-child { border-bottom: 0; }
.svs-rank-num {
  font-family: 'Space Grotesk';
  font-weight: 700;
  color: var(--ice);
  font-size: 0.95rem;
}
.svs-rank-tag {
  font-family: 'Space Grotesk';
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 5px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  text-align: center;
}
.svs-rank-name { color: var(--text); }
.svs-rank-score {
  font-family: 'Space Grotesk';
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
}

.svs-notes {
  font-size: 0.88rem;
  color: var(--text-dim);
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  border-left: 3px solid var(--border-2);
  margin-bottom: 12px;
  font-style: italic;
  line-height: 1.5;
}
.svs-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* Rotation list */
.rot-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.rot-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
  border-radius: 9px;
}
.rot-num {
  font-family: 'Space Grotesk';
  font-weight: 700;
  color: var(--ice);
  width: 18px;
  font-size: 0.9rem;
}
.rot-tag {
  font-family: 'Space Grotesk';
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 5px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
  min-width: 38px;
  text-align: center;
}
.rot-name {
  flex: 1;
  font-size: 0.88rem;
  color: var(--text);
  font-weight: 500;
}
.rot-actions {
  display: flex; gap: 4px;
}
.rot-move, .rot-remove {
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 6px;
  color: var(--text-dim);
  cursor: pointer;
  width: 22px; height: 22px;
  font-size: 0.78rem;
  line-height: 1;
}
.rot-move:hover { color: var(--text); background: var(--surface-2); }
.rot-move:disabled { opacity: 0.3; cursor: not-allowed; }
.rot-remove:hover { color: #f87171; border-color: rgba(248, 113, 113, 0.4); }

.rot-candidates {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 8px;
}
.rot-add {
  appearance: none;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 10px;
  background: rgba(125, 211, 252, 0.08);
  border: 1px dashed var(--border-2);
  border-radius: 999px;
  color: var(--ice);
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
}
.rot-add:hover { background: rgba(125, 211, 252, 0.16); border-style: solid; }

/* Rank input table (in SVS form) */
.rank-tbl {
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.rank-row {
  display: grid;
  grid-template-columns: 1.5fr 80px 1fr;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.rank-row:last-child { border-bottom: 0; }
.rank-row.head {
  background: rgba(0, 0, 0, 0.28);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.rank-name {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.9rem;
  color: var(--text);
}
.rank-row input {
  padding: 7px 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-2);
  border-radius: 7px;
  color: var(--text);
  font: inherit;
  font-size: 0.86rem;
  outline: none;
}
/* ── Rich text editor ── */
.rte {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  overflow: hidden;
}
.rte:focus-within { border-color: var(--ice); box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.15); }
.rte-toolbar {
  display: flex; flex-wrap: wrap; gap: 2px;
  padding: 6px;
  background: rgba(0, 0, 0, 0.30);
  border-bottom: 1px solid var(--border);
}
.rte-toolbar button {
  appearance: none;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-dim);
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  min-width: 30px;
  height: 28px;
  padding: 0 8px;
  line-height: 1;
}
.rte-toolbar button:hover { background: var(--surface); color: var(--text); }
.rte-toolbar button.on { background: var(--surface-2); color: var(--ice); border-color: var(--border-2); }
.rte-sep {
  width: 1px;
  background: var(--border);
  margin: 4px 4px;
}
.rte-content {
  padding: 12px 14px;
  outline: none;
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.55;
}
.rte-content:empty::before {
  content: attr(data-placeholder);
  color: var(--text-faint);
  pointer-events: none;
}
.rte-content p { margin: 0 0 8px; }
.rte-content ul, .rte-content ol { margin: 0 0 8px; padding-left: 22px; }
.rte-content li { margin: 2px 0; }
.rte-content a { color: var(--ice); text-decoration: underline; }
.rte-content b, .rte-content strong { font-weight: 700; }
.rte-content i, .rte-content em { font-style: italic; }
.rte-content u { text-decoration: underline; }

.rte-picker {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 2px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.32);
  border-bottom: 1px solid var(--border);
  max-height: 200px;
  overflow-y: auto;
}
.rte-picker.game {
  grid-template-columns: repeat(4, 1fr);
}
.rte-emoji {
  appearance: none;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 1.1rem;
  width: 100%;
  aspect-ratio: 1;
  cursor: pointer;
  display: grid; place-items: center;
  padding: 0;
  color: var(--text);
}
.rte-emoji:hover { background: var(--surface); border-color: var(--border-2); }
.rte-emoji.game-emoji {
  aspect-ratio: auto;
  flex-direction: column;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 4px;
}
.rte-emoji .ge { font-size: 1.5rem; line-height: 1; }
.rte-emoji .gl {
  font-size: 0.66rem;
  color: var(--text-dim);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
@media (max-width: 600px) {
  .rte-picker { grid-template-columns: repeat(7, 1fr); }
  .rte-picker.game { grid-template-columns: repeat(3, 1fr); }
}

.svs-notes p:last-child, .svs-notes ul:last-child, .svs-notes ol:last-child { margin-bottom: 0; }

/* ── Tooltip ── */
.infotip {
  display: inline-flex;
  align-items: center;
  position: relative;
  margin-left: 6px;
  outline: none;
  cursor: help;
  vertical-align: middle;
}
.infotip-dot {
  display: inline-grid;
  place-items: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border-2);
  color: var(--text-faint);
  transition: color .15s, border-color .15s, background .15s;
}
.infotip:hover .infotip-dot,
.infotip:focus .infotip-dot {
  color: var(--ice);
  border-color: var(--ice);
  background: rgba(125, 211, 252, 0.10);
}
.infotip-bubble {
  position: absolute;
  z-index: 220;
  width: 280px;
  padding: 12px 14px;
  background: rgba(8, 16, 32, 0.96);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--text);
  line-height: 1.5;
  letter-spacing: 0;
  text-transform: none;
  box-shadow: 0 14px 40px -10px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  white-space: normal;
}
.infotip-bubble b { font-family: 'Space Grotesk'; font-weight: 600; }
.infotip-top {
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
}
.infotip-bottom {
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
}
.infotip-right { left: calc(100% + 8px); top: 50%; transform: translateY(-50%); }
.infotip-left  { right: calc(100% + 8px); top: 50%; transform: translateY(-50%); }

/* Arrow */
.infotip-bubble::before {
  content: "";
  position: absolute;
  width: 8px; height: 8px;
  background: rgba(8, 16, 32, 0.96);
  border-left: 1px solid var(--border-2);
  border-top: 1px solid var(--border-2);
}
.infotip-top::before    { bottom: -5px; left: 50%; transform: translateX(-50%) rotate(225deg); }
.infotip-bottom::before { top: -5px; left: 50%; transform: translateX(-50%) rotate(45deg); }
.infotip-right::before  { left: -5px; top: 50%; transform: translateY(-50%) rotate(-45deg); }
.infotip-left::before   { right: -5px; top: 50%; transform: translateY(-50%) rotate(135deg); }

@media (max-width: 480px) {
  .infotip-bubble { width: 220px; }
}

/* Suppress old NAP-related selectors that conflict */
.req-tbl, .req-row, .req-grid { all: unset; display: contents; }
