/* CipherK portal + team extensions */

/* Slim auth header: logo + account actions only */
.auth-layout .nav-links,
.auth-layout .mobile-menu {
  display: none !important;
}

.auth-layout .nav-shell {
  justify-content: space-between;
}

.auth-footer-links {
  margin-top: 1.25rem;
  color: #4a6368;
  font-size: 0.92rem;
}

.auth-footer-links a {
  color: #167f7d;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-footer-links a:hover {
  color: #0f5f5d;
}

.auth-check {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin: 0.5rem 0 1rem;
  font-size: 0.9rem;
  color: #627679;
}

.portal-empty {
  padding: 1.5rem 0.25rem;
  color: rgba(190, 210, 230, 0.78);
}

.portal-empty p {
  margin: 0 0 0.85rem;
  max-width: 36rem;
  line-height: 1.55;
}

.portal-empty .button {
  margin-top: 0.25rem;
}

.team-section {
  padding: 5rem 0 4rem;
  background: linear-gradient(180deg, rgba(7, 17, 27, 0.2), rgba(10, 24, 38, 0.85));
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.team-card {
  border: 1px solid rgba(140, 180, 210, 0.18);
  background: rgba(8, 18, 30, 0.72);
  padding: 1.5rem 1.25rem 1.75rem;
  text-align: center;
}

.team-avatar {
  width: 84px;
  height: 84px;
  margin: 0 auto 1rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #d7ecff;
  background: radial-gradient(circle at 30% 30%, #2f6f9a, #0d2438 70%);
  border: 1px solid rgba(150, 200, 230, 0.35);
}

.team-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.team-card p {
  margin: 0;
  color: rgba(190, 210, 230, 0.75);
  font-size: 0.92rem;
}

.portal-shell {
  min-height: calc(100vh - 140px);
  padding: 2.5rem 1.25rem 4rem;
  max-width: 1100px;
  margin: 0 auto;
}

.portal-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 2rem;
}

.portal-header h1 {
  margin: 0.25rem 0 0;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.portal-kicker {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  color: rgba(160, 200, 230, 0.7);
}

.portal-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.portal-stat {
  border: 1px solid rgba(140, 180, 210, 0.16);
  background: rgba(8, 18, 30, 0.65);
  padding: 1.1rem 1.2rem;
}

.portal-stat strong {
  display: block;
  font-size: 1.6rem;
  margin-top: 0.35rem;
}

.portal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.portal-table {
  width: 100%;
  border-collapse: collapse;
}

.portal-table th,
.portal-table td {
  text-align: left;
  padding: 0.85rem 0.75rem;
  border-bottom: 1px solid rgba(140, 180, 210, 0.14);
  vertical-align: top;
}

.portal-table th {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(170, 200, 225, 0.7);
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border: 1px solid rgba(140, 180, 210, 0.28);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-ready { color: #8dffb0; border-color: rgba(141, 255, 176, 0.35); }
.badge-progress { color: #9fd0ff; border-color: rgba(159, 208, 255, 0.35); }
.badge-closed { color: rgba(200, 210, 220, 0.7); }

.alert {
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(140, 180, 210, 0.25);
  background: rgba(12, 28, 44, 0.8);
}

.alert-error { border-color: rgba(255, 120, 120, 0.4); color: #ffb4b4; }
.alert-success { border-color: rgba(120, 220, 160, 0.4); color: #b8f0cc; }

.portal-form {
  display: grid;
  gap: 1rem;
  max-width: 720px;
}

.portal-form label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  color: rgba(190, 210, 230, 0.85);
}

.portal-form input,
.portal-form select,
.portal-form textarea {
  width: 100%;
  box-sizing: border-box;
  background: rgba(5, 14, 24, 0.85);
  border: 1px solid rgba(140, 180, 210, 0.22);
  color: #e8f2fa;
  padding: 0.7rem 0.8rem;
  font: inherit;
}

.portal-form textarea { min-height: 120px; resize: vertical; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.status-track {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 1.5rem;
}

.status-step {
  padding: 0.35rem 0.65rem;
  border: 1px solid rgba(140, 180, 210, 0.2);
  font-size: 0.75rem;
  opacity: 0.45;
}

.status-step.is-done,
.status-step.is-current {
  opacity: 1;
  border-color: rgba(140, 210, 255, 0.45);
}

.status-step.is-current {
  background: rgba(40, 90, 130, 0.35);
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline li {
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(140, 180, 210, 0.12);
}

.timeline time {
  display: block;
  font-size: 0.75rem;
  color: rgba(170, 200, 225, 0.65);
  margin-bottom: 0.25rem;
}

.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.file-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(140, 180, 210, 0.12);
}

.panel {
  border: 1px solid rgba(140, 180, 210, 0.16);
  background: rgba(8, 18, 30, 0.55);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.panel h2 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
}

.nav-account form {
  display: inline;
}

.nav-account button.linkish {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 0;
}

@media (max-width: 900px) {
  .team-grid,
  .portal-stats,
  .form-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .team-grid,
  .portal-stats,
  .form-row {
    grid-template-columns: 1fr;
  }
  .portal-header {
    flex-direction: column;
    align-items: start;
  }
}

/* ===== Admin shell ===== */
.admin-body {
  margin: 0;
  background: #07111b;
  color: #e8f2fa;
  font-family: "DM Sans", sans-serif;
}

.admin-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.admin-sidebar {
  background: #0a1824;
  border-right: 1px solid rgba(140, 180, 210, 0.14);
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: #eef5f5;
}

.admin-brand img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.admin-nav {
  display: grid;
  gap: 0.35rem;
}

.admin-nav a {
  padding: 0.65rem 0.75rem;
  border-radius: 4px;
  color: rgba(190, 210, 230, 0.8);
  text-decoration: none;
  font-size: 0.92rem;
}

.admin-nav a:hover,
.admin-nav a.is-active {
  background: rgba(40, 90, 130, 0.35);
  color: #fff;
}

.admin-sidebar-foot {
  margin-top: auto;
  font-size: 0.85rem;
}

.admin-sidebar-foot a {
  color: rgba(160, 200, 230, 0.75);
}

.admin-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid rgba(140, 180, 210, 0.12);
  background: rgba(8, 18, 30, 0.65);
}

.admin-topbar-kicker {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
  color: rgba(160, 200, 230, 0.65);
}

.admin-topbar-title {
  margin: 0.2rem 0 0;
  font-size: 1.45rem;
}

.admin-topbar-user {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.9rem;
}

.admin-logout {
  min-height: 36px;
  padding: 0 14px;
  font-size: 12px;
}

.admin-content {
  padding: 1.5rem 1.75rem 2.5rem;
}

.admin-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
  align-items: end;
}

.admin-filters label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: rgba(190, 210, 230, 0.75);
}

.admin-filters input,
.admin-filters select {
  background: rgba(5, 14, 24, 0.85);
  border: 1px solid rgba(140, 180, 210, 0.22);
  color: #e8f2fa;
  padding: 0.55rem 0.7rem;
  font: inherit;
  min-width: 140px;
}

.metric-bars {
  display: grid;
  gap: 0.65rem;
}

.metric-bar-row {
  display: grid;
  grid-template-columns: 120px 1fr 48px;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.85rem;
}

.metric-bar-track {
  height: 10px;
  background: rgba(140, 180, 210, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

.metric-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #37a8ff, #54f2dd);
}

.admin-split {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.25rem;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.badge-off {
  color: #ffb4b4;
  border-color: rgba(255, 120, 120, 0.4);
}

.admin-bar {
  height: 10px;
  min-width: 48px;
  max-width: 220px;
  border-radius: 999px;
  background: rgba(140, 180, 210, 0.12);
  position: relative;
  overflow: hidden;
}

.admin-bar::after {
  content: "";
  display: block;
  height: 100%;
  width: var(--pct, 0%);
  background: linear-gradient(90deg, #37a8ff, #54f2dd);
}

.admin-team-row,
.admin-faq-row {
  margin-bottom: 0.85rem;
}

.admin-faq-row {
  display: grid;
  gap: 0.5rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(140, 180, 210, 0.1);
}

/* ---------- Site CMS ---------- */
.site-cms {
  padding-bottom: 5.5rem;
}

.site-cms-tabs {
  margin-bottom: 1.25rem;
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(7, 17, 27, 0.92);
  backdrop-filter: blur(8px);
  padding-top: 0.25rem;
}

.site-cms-section-head {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 1rem;
}

.site-cms-section-head h2 {
  margin-bottom: 0.35rem;
}

.site-cms-section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.site-cms-list {
  display: grid;
  gap: 0.85rem;
}

.site-cms-card {
  border: 1px solid rgba(140, 180, 210, 0.16);
  border-radius: 8px;
  background: rgba(5, 14, 24, 0.55);
  padding: 0.85rem 1rem;
}

.site-cms-card-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.site-cms-card-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.site-cms-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, rgba(55, 168, 255, 0.35), rgba(84, 242, 221, 0.25));
  border: 1px solid rgba(140, 180, 210, 0.22);
  color: #e8f2fa;
  flex-shrink: 0;
}

.site-cms-card-fields {
  display: grid;
  gap: 0.75rem;
}

.site-cms-team-card .site-cms-card-fields {
  grid-template-columns: 1.4fr 1.2fr 0.5fr;
}

.site-cms-card-fields label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: rgba(190, 210, 230, 0.75);
}

.site-cms-faq-toggle {
  border: 0;
  background: transparent;
  color: #e8f2fa;
  font: inherit;
  text-align: left;
  cursor: pointer;
  padding: 0;
  flex: 1;
  min-width: 0;
}

.site-cms-faq-title {
  display: block;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-cms-faq-card .site-cms-faq-body {
  display: none;
}

.site-cms-faq-card.is-open .site-cms-faq-body {
  display: grid;
}

.site-cms-remove {
  color: #ffb4b4 !important;
}

.site-cms-sticky {
  position: fixed;
  left: 240px;
  right: 0;
  bottom: 0;
  z-index: 20;
  border-top: 1px solid rgba(140, 180, 210, 0.16);
  background: rgba(8, 18, 30, 0.94);
  backdrop-filter: blur(10px);
}

.site-cms-sticky-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.85rem 1.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  justify-content: flex-end;
}

.site-cms-dirty {
  margin-right: auto;
  font-size: 0.82rem;
  color: #f0c674;
}

.site-cms-preview {
  display: grid;
  gap: 1.25rem;
}

.site-cms-preview-block h3 {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
}

.site-cms-preview-team {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}

.site-cms-preview-member {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  padding: 0.65rem;
  border: 1px solid rgba(140, 180, 210, 0.14);
  border-radius: 8px;
}

.site-cms-preview-member strong {
  display: block;
  font-size: 0.9rem;
}

.site-cms-preview-member span {
  display: block;
  font-size: 0.78rem;
  color: rgba(190, 210, 230, 0.7);
}

.site-cms-preview-faq {
  display: grid;
  gap: 0.5rem;
}

.site-cms-preview-faq-item {
  border: 1px solid rgba(140, 180, 210, 0.14);
  border-radius: 6px;
  padding: 0.55rem 0.75rem;
}

.site-cms-preview-faq-item summary {
  cursor: pointer;
  font-weight: 600;
}

.site-cms-preview-faq-item p {
  margin: 0.5rem 0 0;
  color: rgba(210, 225, 235, 0.85);
  font-size: 0.9rem;
}

.admin-nav-group {
  margin: 0.85rem 0 0.35rem;
  padding: 0 0.75rem;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(160, 200, 230, 0.45);
}

.admin-nav-group:first-child {
  margin-top: 0;
}

.admin-row-meta {
  display: block;
  font-size: 0.78rem;
  color: rgba(190, 210, 230, 0.55);
  margin-top: 0.15rem;
}

.admin-action-chip {
  display: inline-block;
  font-family: "DM Mono", monospace;
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  border: 1px solid rgba(140, 180, 210, 0.22);
  color: rgba(200, 220, 235, 0.9);
  background: rgba(40, 90, 130, 0.2);
}

.admin-profile-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 960px) {
  .admin-profile-grid {
    grid-template-columns: 1.4fr 0.9fr;
  }
}

@media (max-width: 960px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
  .admin-nav {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow-x: auto;
    width: 100%;
  }
  .admin-sidebar-foot {
    margin-top: 0;
  }
  .admin-split {
    grid-template-columns: 1fr;
  }
  .metric-bar-row {
    grid-template-columns: 90px 1fr 40px;
  }
  .site-cms-sticky {
    left: 0;
  }
  .site-cms-team-card .site-cms-card-fields {
    grid-template-columns: 1fr;
  }
}
