/**
 * RBS Plugin Repository — Brand Styles
 * Roadbear Studios brand colors and shared components
 * Typography: Stag (headings), Open Sans (body) — matches RBS brand
 */

/* Stag — display font for headings (Commercial Type, licensed) */
@font-face {
  font-family: 'Stag';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/Stag-Regular.woff2') format('woff2');
}

/* Open Sans — locally hosted (latin subset) */
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/open-sans-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('./fonts/open-sans-latin-500-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('./fonts/open-sans-latin-600-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('./fonts/open-sans-latin-700-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Brand colors */
  --rbs-red: #EB5A49;
  --rbs-red-hover: #d94a3a;
  --rbs-yellow: #F5B400;
  --rbs-yellow-light: #fde68a;
  --rbs-blue: #86CCCC;
  --rbs-blue-light: #b8e0e0;
  --rbs-black: #000000;
  --rbs-white: #ffffff;

  /* Semantic */
  --rbs-bg: #ffffff;
  --rbs-bg-alt: #f8fafc;
  --rbs-text: #1e293b;
  --rbs-text-muted: #64748b;
  --rbs-border: #e2e8f0;
  --rbs-border-focus: var(--rbs-blue);
  --rbs-success: #16a34a;
  --rbs-success-bg: #dcfce7;
}

/* Reset & base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Open Sans', Arial, sans-serif;
  font-weight: 500;
  background: var(--rbs-bg-alt);
  color: var(--rbs-text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.7em;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Stag', 'Open Sans', Arial, sans-serif;
  font-weight: 600;
  color: var(--rbs-text);
}

h1 { font-size: 1.875rem; }
h2 { font-size: 1.625rem; }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

code {
  font-family: 'Courier New', ui-monospace, monospace;
}

a {
  color: var(--rbs-blue);
  text-decoration: none;
}

a:hover {
  color: var(--rbs-black);
  text-decoration: underline;
}

/* Logo */
.rbs-logo {
  display: block;
  height: 32px;
  width: auto;
  max-width: 140px;
}

.rbs-logo--large {
  height: 40px;
  max-width: 180px;
  margin-bottom: 1rem;
}

/* Cards */
.rbs-card {
  background: var(--rbs-white);
  border: 1px solid var(--rbs-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Buttons */
.rbs-btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s, background-color 0.15s;
}

.rbs-btn:hover {
  opacity: 0.9;
}

.rbs-btn:focus-visible {
  outline: 2px solid var(--rbs-border-focus);
  outline-offset: 2px;
}

.rbs-btn-primary {
  background: var(--rbs-red);
  color: var(--rbs-white);
}

.rbs-btn-primary:hover {
  background: var(--rbs-red-hover);
}

.rbs-btn-danger {
  background: var(--rbs-red);
  color: var(--rbs-white);
}

.rbs-btn-success {
  background: var(--rbs-success);
  color: var(--rbs-white);
}

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

.rbs-btn-ghost:hover {
  background: var(--rbs-bg-alt);
  color: var(--rbs-text);
}

/* Form elements */
.rbs-form-row {
  margin-bottom: 1rem;
}

.rbs-form-row label {
  display: block;
  font-size: 0.8rem;
  color: var(--rbs-text-muted);
  margin-bottom: 0.35rem;
  font-weight: 500;
}

.rbs-form-row input,
.rbs-form-row textarea,
.rbs-form-row select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  background: var(--rbs-white);
  border: 1px solid var(--rbs-border);
  border-radius: 8px;
  color: var(--rbs-text);
  font-size: 0.9rem;
  font-family: inherit;
}

.rbs-form-row input:focus,
.rbs-form-row textarea:focus,
.rbs-form-row select:focus {
  outline: none;
  border-color: var(--rbs-border-focus);
  box-shadow: 0 0 0 3px rgba(134, 204, 204, 0.2);
}

.rbs-form-row textarea {
  resize: vertical;
  min-height: 80px;
}

.rbs-hint {
  font-size: 0.75rem;
  color: var(--rbs-text-muted);
  margin-top: 0.25rem;
}

/* Badges */
.rbs-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.rbs-badge-active {
  background: var(--rbs-success-bg);
  color: var(--rbs-success);
}

.rbs-badge-revoked {
  background: #fef2f2;
  color: var(--rbs-red);
}

.rbs-badge-current {
  background: rgba(134, 204, 204, 0.25);
  color: #2d7a7a;
}

.rbs-badge-pending {
  background: rgba(245, 180, 0, 0.25);
  color: #b8860b;
}

/* Notices / Messages */
.rbs-msg {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  line-height: 1.5;
}

.rbs-msg.success {
  background: var(--rbs-success-bg);
  color: var(--rbs-success);
  border: 1px solid #86efac;
}

.rbs-msg.error {
  background: #fef2f2;
  color: var(--rbs-red);
  border: 1px solid #fecaca;
}

/* Geometric accent — diagonal strip */
.rbs-accent-strip {
  position: absolute;
  top: 0;
  right: 0;
  width: 120px;
  height: 120px;
  background: linear-gradient(135deg, var(--rbs-blue) 0%, transparent 70%);
  opacity: 0.15;
  pointer-events: none;
}

/* -------------------------------------------------------------------------
   Admin — Login page
   ------------------------------------------------------------------------- */
body.rbs-admin-login {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.login-wrap {
  position: relative;
}

.login-card {
  background: var(--rbs-white);
  border: 1px solid var(--rbs-border);
  border-radius: 12px;
  padding: 2rem;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.login-card h1 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
  color: var(--rbs-black);
}

.login-card .sub {
  color: var(--rbs-text-muted);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

.login-card .rbs-form-row {
  margin-bottom: 1rem;
}

.login-card input[type="password"] {
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: var(--rbs-bg-alt);
  border: 1px solid var(--rbs-border);
  border-radius: 8px;
  color: var(--rbs-text);
  font-size: 1rem;
}

.login-card input[type="password"]:focus {
  outline: none;
  border-color: var(--rbs-blue);
  box-shadow: 0 0 0 3px rgba(134, 204, 204, 0.2);
}

.login-card button {
  width: 100%;
  margin-top: 1rem;
  padding: 0.65rem;
  background: var(--rbs-red);
  border: none;
  border-radius: 8px;
  color: var(--rbs-white);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.login-card button:hover {
  background: var(--rbs-red-hover);
}

.login-card button:focus-visible {
  outline: 2px solid var(--rbs-blue);
  outline-offset: 2px;
}

.login-card .err {
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--rbs-red);
}

/* -------------------------------------------------------------------------
   Admin — Dashboard
   ------------------------------------------------------------------------- */
.rbs-admin main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.75rem 2rem;
}

.rbs-admin .header {
  background: var(--rbs-white);
  border-bottom: 1px solid var(--rbs-border);
  padding: 0.85rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.rbs-admin .header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.rbs-admin .header h1 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--rbs-black);
}

.rbs-admin .header a {
  color: var(--rbs-text-muted);
  font-size: 0.82rem;
}

.rbs-admin .header a:hover {
  color: var(--rbs-blue);
}

/* View tabs */
.rbs-view-tabs {
  display: flex;
  gap: 0;
  background: var(--rbs-white);
  border-bottom: 1px solid var(--rbs-border);
  padding: 0 2rem;
}

.rbs-tab {
  padding: 0.85rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--rbs-text-muted);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rbs-tab:hover {
  color: var(--rbs-text);
}

.rbs-tab-active {
  color: var(--rbs-blue);
  border-bottom-color: var(--rbs-blue);
}

.rbs-tab-count {
  background: var(--rbs-yellow);
  color: var(--rbs-black);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
}

/* Pending summary link (plugins view) */
.pending-summary {
  margin-bottom: 1.5rem;
}

.rbs-pending-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(245, 180, 0, 0.15);
  border: 1px solid rgba(245, 180, 0, 0.4);
  border-radius: 8px;
  color: #7c5c0a;
  text-decoration: none;
  font-weight: 500;
}

.rbs-pending-link:hover {
  background: rgba(245, 180, 0, 0.25);
}

.pending-summary .pending-count {
  background: var(--rbs-yellow);
  color: var(--rbs-black);
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 700;
}

/* Admin toolbar — search, sort, per-page */
.rbs-admin-toolbar {
  background: var(--rbs-white);
  border: 1px solid var(--rbs-border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.rbs-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.rbs-toolbar-search input[type="search"] {
  min-width: 200px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--rbs-border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
}

.rbs-toolbar-search input[type="search"]:focus {
  outline: none;
  border-color: var(--rbs-border-focus);
  box-shadow: 0 0 0 3px rgba(134, 204, 204, 0.2);
}

.rbs-toolbar-sort,
.rbs-toolbar-perpage {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rbs-toolbar-sort label,
.rbs-toolbar-perpage label {
  font-size: 0.82rem;
  color: var(--rbs-text-muted);
  white-space: nowrap;
}

.rbs-toolbar-sort select,
.rbs-toolbar-perpage select {
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--rbs-border);
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: inherit;
  background: var(--rbs-white);
}

.rbs-toolbar-viewmode {
  display: flex;
  gap: 0.25rem;
}

.rbs-toolbar-viewmode .rbs-btn {
  padding: 0.4rem 0.65rem;
}

.rbs-viewmode-active {
  background: var(--rbs-bg-alt);
  color: var(--rbs-text);
}

/* List view table */
.rbs-plugin-list-view {
  background: var(--rbs-white);
  border: 1px solid var(--rbs-border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.rbs-list-table {
  width: 100%;
}

.rbs-list-table th {
  text-align: left;
  padding: 0.65rem 1rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--rbs-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--rbs-border);
}

.rbs-list-table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--rbs-border);
}

.rbs-list-table tr:last-child td {
  border-bottom: none;
}

.rbs-list-table tr:hover td {
  background: var(--rbs-bg-alt);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Jump-to-plugin navigation */
.rbs-main-with-nav {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.rbs-plugin-list {
  flex: 1;
  min-width: 0;
}

.rbs-jump-nav {
  position: sticky;
  top: 1rem;
  flex-shrink: 0;
  width: 180px;
  background: var(--rbs-white);
  border: 1px solid var(--rbs-border);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.rbs-jump-nav-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--rbs-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.rbs-jump-nav-list {
  list-style: none;
}

.rbs-jump-nav-list li {
  margin-bottom: 0.35rem;
}

.rbs-jump-nav-list a {
  font-size: 0.85rem;
  color: var(--rbs-text);
  text-decoration: none;
  display: block;
  padding: 0.25rem 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rbs-jump-nav-list a:hover {
  color: var(--rbs-blue);
}

.upload-card {
  background: var(--rbs-white);
  border: 1px solid var(--rbs-border);
  border-radius: 12px;
  margin-bottom: 2rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.upload-card summary {
  padding: 1rem 1.25rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  color: var(--rbs-blue);
}

.upload-card summary::before {
  content: "▶";
  font-size: 0.65rem;
  transition: transform 0.2s;
}

.upload-card[open] summary::before {
  transform: rotate(90deg);
}

.upload-card .body {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--rbs-border);
}

.plugin-card {
  background: var(--rbs-white);
  border: 1px solid var(--rbs-border);
  border-radius: 12px;
  margin-bottom: 1.5rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.plugin-header {
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--rbs-border);
}

.plugin-title {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.plugin-title h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--rbs-text);
}

.plugin-slug {
  color: var(--rbs-text-muted);
  font-size: 0.8rem;
}

.plugin-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.version-badge {
  background: rgba(22, 163, 74, 0.15);
  color: #0d6b2c;
  border-radius: 999px;
  padding: 0.15rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.rbs-btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

.plugin-body {
  padding: 0;
}

.plugin-section {
  border-bottom: 1px solid var(--rbs-border);
}

.plugin-section:last-child {
  border-bottom: none;
}

.plugin-section > details > summary,
.plugin-section-header {
  padding: 0.7rem 1.5rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--rbs-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--rbs-bg-alt);
}

.plugin-section > details > summary {
  cursor: pointer;
}

.plugin-section > details > summary::before {
  content: "▶";
  font-size: 0.6rem;
  margin-right: 0.5rem;
  transition: transform 0.2s;
}

.plugin-section > details[open] > summary::before {
  transform: rotate(90deg);
}

.plugin-section-body {
  padding: 1rem 1.5rem;
}

.rbs-admin table,
.rbs-admin .plugin-card table {
  width: 100%;
  border-collapse: collapse;
}

.rbs-admin th,
.rbs-admin .plugin-card th {
  text-align: left;
  padding: 0.5rem 0.65rem;
  color: var(--rbs-text-muted);
  font-weight: 500;
  font-size: 0.78rem;
  border-bottom: 1px solid var(--rbs-border);
  white-space: nowrap;
}

.rbs-admin td,
.rbs-admin .plugin-card td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--rbs-border);
  vertical-align: middle;
  font-size: 0.85rem;
}

.rbs-admin tr:last-child td,
.rbs-admin .plugin-card tr:last-child td {
  border-bottom: none;
}

.rbs-admin tr:hover td,
.rbs-admin .plugin-card tr:hover td {
  background: var(--rbs-bg-alt);
}

.key-code {
  font-family: "Courier New", monospace;
  letter-spacing: 0.06em;
  color: var(--rbs-text);
  font-size: 0.8rem;
}

.form-row {
  margin-bottom: 0.85rem;
}

.form-row label {
  display: block;
  font-size: 0.8rem;
  color: var(--rbs-text-muted);
  margin-bottom: 0.3rem;
}

.form-row input,
.form-row textarea,
.form-row select {
  width: 100%;
  padding: 0.5rem 0.65rem;
  background: var(--rbs-white);
  border: 1px solid var(--rbs-border);
  border-radius: 8px;
  color: var(--rbs-text);
  font-size: 0.875rem;
  font-family: inherit;
}

.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
  outline: none;
  border-color: var(--rbs-blue);
  box-shadow: 0 0 0 3px rgba(134, 204, 204, 0.2);
}

.form-row textarea {
  resize: vertical;
  min-height: 80px;
}

.hint {
  font-size: 0.72rem;
  color: var(--rbs-text-muted);
  margin-top: 0.25rem;
}

.form-inline {
  display: flex;
  gap: 0.6rem;
  align-items: flex-end;
}

.form-inline .form-row {
  flex: 1;
  margin-bottom: 0;
}

.keygen-wrap {
  background: var(--rbs-bg-alt);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  border: 1px solid var(--rbs-border);
}

.keygen-wrap h4 {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--rbs-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.pending-card {
  background: var(--rbs-white);
  border: 1px solid rgba(245, 180, 0, 0.5);
  border-left: 4px solid var(--rbs-yellow);
  border-radius: 12px;
  margin-bottom: 2rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.pending-card-header {
  padding: 1rem 1.5rem;
  background: rgba(245, 180, 0, 0.1);
  border-bottom: 1px solid rgba(245, 180, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pending-card-header h2 {
  font-size: 1rem;
  font-weight: 600;
  color: #7c5c0a;
}

.pending-card-body {
  padding: 1rem 1.5rem;
}

.pending-count {
  background: var(--rbs-yellow);
  color: var(--rbs-black);
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 700;
}

.empty {
  color: var(--rbs-text-muted);
  text-align: center;
  padding: 1.5rem 0;
  font-size: 0.85rem;
}

@media (max-width: 700px) {
  .rbs-main-with-nav {
    flex-direction: column;
  }

  .rbs-jump-nav {
    position: static;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
  }

  .rbs-toolbar-row {
    flex-direction: column;
    align-items: stretch;
  }

  .rbs-toolbar-search input[type="search"] {
    min-width: 0;
  }

  .plugin-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .form-inline {
    flex-direction: column;
  }

  .rbs-admin th:nth-child(4),
  .rbs-admin td:nth-child(4),
  .rbs-admin th:nth-child(5),
  .rbs-admin td:nth-child(5) {
    display: none;
  }
}

/* -------------------------------------------------------------------------
   Register page
   ------------------------------------------------------------------------- */
body.rbs-register {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.reg-card {
  background: var(--rbs-white);
  border: 1px solid var(--rbs-border);
  border-radius: 12px;
  padding: 2rem 2.5rem;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.reg-card .icon {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 0.85rem;
  display: block;
}

.reg-card h1 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--rbs-black);
  margin-bottom: 0.3rem;
}

.reg-card .sub {
  color: var(--rbs-text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.info-box {
  background: var(--rbs-bg-alt);
  border: 1px solid var(--rbs-border);
  border-radius: 8px;
  padding: 0.85rem 1.1rem;
  margin-bottom: 1.5rem;
}

.info-box dt {
  color: var(--rbs-text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.7rem;
  margin-bottom: 0.15rem;
}

.info-box dt:first-child {
  margin-top: 0;
}

.info-box dd {
  color: var(--rbs-text);
  font-size: 0.875rem;
  word-break: break-all;
}

.section-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--rbs-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.6rem;
}

.reg-card label {
  display: block;
  font-size: 0.8rem;
  color: var(--rbs-text-muted);
  margin-bottom: 0.3rem;
}

.reg-card input[type="password"] {
  width: 100%;
  padding: 0.55rem 0.75rem;
  background: var(--rbs-bg-alt);
  border: 1px solid var(--rbs-border);
  border-radius: 8px;
  color: var(--rbs-text);
  font-size: 0.9rem;
  font-family: inherit;
}

.reg-card input[type="password"]:focus {
  outline: none;
  border-color: var(--rbs-blue);
  box-shadow: 0 0 0 3px rgba(134, 204, 204, 0.2);
}

.reg-card .rbs-btn {
  display: block;
  width: 100%;
  margin-top: 0.75rem;
}

.reg-card-hint {
  color: var(--rbs-text-muted);
  font-size: 0.8rem;
  line-height: 1.5;
  margin-bottom: 0.6rem;
}

.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0;
  color: var(--rbs-text-muted);
  font-size: 0.78rem;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rbs-border);
}

.notice {
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.82rem;
  line-height: 1.5;
  margin-bottom: 0.85rem;
}

.notice-err {
  background: #fef2f2;
  color: var(--rbs-red);
  border: 1px solid #fecaca;
}

.notice-ok {
  background: var(--rbs-success-bg);
  color: var(--rbs-success);
  border: 1px solid #86efac;
}

/* Utility classes */
.text-muted { color: var(--rbs-text-muted); }
.text-muted-sm { color: var(--rbs-text-muted); font-size: 0.78rem; }
.text-nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.form-inline-actions { display: inline; }
.form-inline-actions + .form-inline-actions { margin-left: 0.4rem; }
.upload-intro { color: var(--rbs-text-muted); font-size: 0.82rem; margin-bottom: 1rem; }

/* Asset previews in Manage Assets */
.asset-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.asset-preview {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.asset-preview-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--rbs-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.asset-preview-icon {
  width: 128px;
  height: 128px;
  object-fit: contain;
  border: 1px solid var(--rbs-border);
  border-radius: 8px;
  background: var(--rbs-bg-alt);
}

.asset-preview-banner {
  max-width: 386px;
  height: auto;
  object-fit: contain;
  border: 1px solid var(--rbs-border);
  border-radius: 8px;
  background: var(--rbs-bg-alt);
}
.empty-state { text-align: center; padding: 4rem 0; color: var(--rbs-text-muted); }
.empty-state-title { font-size: 1.1rem; margin-bottom: 0.5rem; }
.empty-state-desc { font-size: 0.85rem; }
.version-count { color: var(--rbs-text-muted); font-weight: 400; font-size: 0.78rem; margin-left: 0.3rem; }
.zip-present { color: var(--rbs-success); font-size: 0.78rem; }
.zip-missing { color: var(--rbs-red); font-size: 0.78rem; }
.keygen-btn { white-space: nowrap; margin-bottom: 0; }
.changelog-textarea { min-height: 100px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; }
.label-hint { color: var(--rbs-text-muted); }
.key-display { font-family: "Courier New", monospace; letter-spacing: 0.05em; }

/* Pagination */
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rbs-border);
}

.pagination-info {
  font-size: 0.85rem;
  color: var(--rbs-text-muted);
}

.pagination-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.pagination-current {
  padding: 0.35rem 0.65rem;
  font-weight: 600;
  color: var(--rbs-text);
  background: var(--rbs-bg-alt);
  border-radius: 8px;
}

.pagination-ellipsis {
  padding: 0 0.35rem;
  color: var(--rbs-text-muted);
  font-size: 0.9rem;
}

.show-more-details {
  margin-top: 1rem;
  border-top: 1px solid var(--rbs-border);
  padding-top: 1rem;
}

.show-more-details summary {
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--rbs-blue);
  font-weight: 500;
}

.show-more-details summary:hover {
  text-decoration: underline;
}

.show-more-details summary::before {
  content: "▶";
  font-size: 0.6rem;
  margin-right: 0.5rem;
  display: inline-block;
  transition: transform 0.2s;
}

.show-more-details[open] summary::before {
  transform: rotate(90deg);
}
