/* OwlRank dashboard / admin shell — left nav + right content.
   Only linked from admin.html & dashboard.html; does not affect main site. */

body.shell-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Top bar ── */
.shell-top {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  border-bottom: 1px solid var(--border);
  background: rgba(7, 9, 15, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.shell-top-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 20px;
  max-width: none;
}

.shell-top-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.shell-top .logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.02em;
  min-width: 0;
}

.shell-top .logo svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.shell-top .logo-text {
  font-size: 1.05rem;
}

.shell-top .shell-title {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-left: 4px;
  padding-left: 12px;
  border-left: 1px solid var(--border);
  white-space: nowrap;
}

.shell-top-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.shell-top-right .who {
  color: var(--text-muted);
  font-size: 0.85rem;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shell-top-right a.link {
  color: var(--text-secondary);
  font-size: 0.85rem;
  white-space: nowrap;
}

.shell-top-right a.link:hover {
  color: var(--accent-mid);
}

/* Hamburger — hidden on desktop */
.shell-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(18, 24, 38, 0.7);
  color: var(--text);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.shell-menu-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  color: #fff;
}

.shell-menu-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Layout ── */
.shell-layout {
  display: flex !important;
  flex-direction: row !important;
  flex: 1;
  min-height: 0;
  width: 100%;
  position: relative;
}

/* ── Overlay (mobile drawer) ── */
.shell-overlay {
  display: none;
  position: fixed;
  inset: 0;
  top: var(--nav-h);
  z-index: 44;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

body.shell-body.shell-nav-open .shell-overlay {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

/* ── Sidebar ── */
.shell-sidebar {
  display: block !important;
  position: sticky;
  top: var(--nav-h);
  align-self: flex-start;
  width: 232px;
  min-width: 232px;
  flex-shrink: 0;
  height: calc(100vh - var(--nav-h));
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(18, 24, 38, 0.95) 0%, rgba(10, 13, 22, 0.92) 100%);
  padding: 20px 12px 32px;
  z-index: 45;
  transition: transform 0.22s ease;
}

.shell-sidebar .side-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 2px 14px 12px;
  font-weight: 600;
}

.shell-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.shell-nav button,
.shell-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  color: var(--text-secondary);
  border-radius: 0 10px 10px 0;
  padding: 11px 14px 11px 11px;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.shell-nav button:hover,
.shell-nav a:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-left-color: rgba(91, 140, 255, 0.35);
}

.shell-nav button.active {
  background: var(--accent-soft);
  border-left-color: var(--accent);
  color: #fff;
  box-shadow: inset 0 0 20px rgba(91, 140, 255, 0.08);
}

.shell-nav button:focus-visible,
.shell-nav a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.shell-nav button .ico,
.shell-nav a .ico {
  width: 1.15em;
  text-align: center;
  opacity: 0.85;
  font-size: 0.95rem;
  flex-shrink: 0;
}

/* ── Main ── */
.shell-main {
  flex: 1;
  min-width: 0;
  padding: 24px 28px 72px;
}

.shell-main .page-head {
  margin-bottom: 20px;
}

.shell-main .page-head h1 {
  font-size: 1.35rem;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
}

.shell-main .page-head .sub {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ── Cards ── */
.shell-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.shell-card {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.shell-card:hover {
  border-color: var(--border-strong);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 0 0 1px rgba(91, 140, 255, 0.06);
}

.shell-card .label {
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.shell-card .value {
  font-size: 1.25rem;
  font-weight: 650;
  margin-top: 4px;
  letter-spacing: -0.03em;
  word-break: break-word;
}

.shell-card .hint {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 4px;
}

/* ── Panels ── */
.shell-panel {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 16px;
}

.shell-panel h2 {
  font-size: 1.05rem;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.01em;
}

.shell-panel.hidden,
.shell-hidden {
  display: none !important;
}

.shell-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px;
}

.shell-row input[type="search"],
.shell-row input[type="text"] {
  flex: 1;
  min-width: 180px;
  background: #0b1020;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  transition: border-color 0.15s;
}

.shell-row input[type="search"]:focus,
.shell-row input[type="text"]:focus {
  outline: none;
  border-color: rgba(91, 140, 255, 0.5);
}

.shell-row input[type="search"]:focus-visible,
.shell-row input[type="text"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* ── Tables ── */
.shell-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -2px;
  border-radius: 8px;
}

.shell-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  min-width: 480px;
}

.shell-table th,
.shell-table td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.shell-table th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: rgba(7, 9, 15, 0.55);
  position: sticky;
  top: 0;
  z-index: 1;
}

.shell-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}

.shell-table tbody tr:hover {
  background: rgba(91, 140, 255, 0.06);
}

.shell-mono {
  font-family: var(--mono);
  font-size: 0.8rem;
}

.shell-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #9ec1ff;
  font-size: 0.75rem;
}

.shell-err {
  color: #f87171;
  margin: 8px 0;
}

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

.shell-key-once {
  background: #0b1020;
  border: 1px dashed var(--accent);
  border-radius: 10px;
  padding: 12px;
  margin: 10px 0;
  word-break: break-all;
}

.shell-gate {
  max-width: 560px;
  margin: 64px auto;
  padding: 32px 28px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 16px;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 12px 40px rgba(0, 0, 0, 0.25);
}

.shell-gate a {
  color: var(--accent-mid);
}

/* ── Responsive: drawer < 900px ── */
@media (max-width: 899px) {
  .shell-menu-btn {
    display: inline-flex;
  }

  .shell-top-inner {
    padding: 0 14px;
  }

  .shell-top .logo-text {
    font-size: 0.95rem;
  }

  .shell-top .shell-title {
    font-size: 0.78rem;
    padding-left: 8px;
    margin-left: 2px;
  }

  .shell-top-right .who {
    max-width: 110px;
  }

  .shell-top-right a.link {
    display: none;
  }

  .shell-sidebar {
    position: fixed;
    left: 0;
    top: var(--nav-h);
    width: min(280px, 82vw);
    min-width: 0;
    height: calc(100vh - var(--nav-h));
    height: calc(100dvh - var(--nav-h));
    border-right: 1px solid var(--border);
    border-bottom: none;
    transform: translateX(-100%);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.4);
    z-index: 46;
  }

  body.shell-body.shell-nav-open .shell-sidebar {
    transform: translateX(0);
  }

  .shell-main {
    width: 100%;
    padding: 18px 16px 64px;
  }

  .shell-cards {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .shell-panel {
    padding: 16px;
  }

  .shell-gate {
    margin: 40px 16px;
    padding: 28px 20px;
  }
}

@media (max-width: 480px) {
  .shell-cards {
    grid-template-columns: 1fr 1fr;
  }

  .shell-top-right .who {
    max-width: 88px;
    font-size: 0.78rem;
  }

  .shell-card .value {
    font-size: 1.1rem;
  }
}

@media (max-width: 360px) {
  .shell-cards {
    grid-template-columns: 1fr;
  }
}


/* ── Filters / pager / API docs (user dashboard gaps) ── */
.shell-filters {
  gap: 12px;
  align-items: flex-end;
}

.shell-filter {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
  flex: 1;
}

.shell-filter > span {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.shell-row select,
.shell-filter select {
  width: 100%;
  background: #0b1020;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s;
}

.shell-row select:focus,
.shell-filter select:focus {
  outline: none;
  border-color: rgba(91, 140, 255, 0.5);
}

.shell-row select:focus-visible,
.shell-filter select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.shell-pager {
  align-items: center;
}

.shell-page-ind {
  color: var(--text-secondary);
  font-size: 0.85rem;
  min-width: 7em;
  text-align: center;
}

.shell-disabled,
button.shell-disabled,
button:disabled.btn {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.shell-key-once-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 8px;
  flex-wrap: wrap;
}

.shell-key-once-row .shell-mono {
  flex: 1;
  min-width: 200px;
  word-break: break-all;
}

.shell-api-docs {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 14px 0;
}

.shell-api-block {
  background: #0b1020;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.shell-api-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.shell-api-block pre {
  margin: 0;
  padding: 12px 14px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  color: #c5d4f5;
  font-size: 0.8rem;
  line-height: 1.55;
}

.shell-copy-btn.shell-copied,
#btn-copy-key.shell-copied {
  color: #86efac;
}

.shell-api-links {
  margin: 8px 0 0;
  padding-left: 18px;
  line-height: 1.9;
}

.shell-api-links a {
  color: var(--accent-mid);
}

.shell-review-toolbar { align-items: end; flex-wrap: wrap; margin: 12px 0; }
.shell-review-toolbar label,
.shell-review-controls label { display: flex; flex-direction: column; gap: 5px; color: var(--text-secondary); }
.shell-review-toolbar select,
.shell-review-controls select,
.shell-review-controls input {
  color-scheme: dark;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 9px 10px;
}
.shell-review-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  padding: 16px;
  margin: 12px 0;
  overflow-wrap: anywhere;
}
.shell-review-card > div:not(.shell-review-controls) { margin: 7px 0; }
.shell-review-controls { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.shell-review-controls label { min-width: 180px; }

@media (max-width: 899px) {
  .shell-filters {
    flex-direction: column;
    align-items: stretch;
  }
  .shell-filter {
    min-width: 0;
  }
}
