/* Prime City — Portal (Login / UCP / ACP) */

body.portal-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.portal-page.login-page {
  overflow-x: hidden;
}

/* ── Nav ── */
.portal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 5%;
  border-bottom: 1px solid var(--border);
  background: rgba(9, 9, 11, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.portal-nav .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
}

.portal-nav .brand img { height: 36px; border-radius: var(--radius-sm); }

.portal-nav-links {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ── Login One-Pager ── */
.login-onepager {
  flex: 1;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  min-height: calc(100vh - 70px);
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  padding: 40px 5% 60px;
  gap: 48px;
  align-items: center;
}

.login-showcase {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.login-showcase .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--prime-bright);
}

.login-showcase .eyebrow::before {
  content: '';
  width: 28px;
  height: 2px;
  background: linear-gradient(90deg, var(--prime), transparent);
}

.login-showcase h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.login-showcase .lead {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.65;
  max-width: 480px;
}

.login-features {
  display: grid;
  gap: 14px;
  margin-top: 8px;
}

.login-feature {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.login-feature:hover {
  border-color: var(--prime-border);
  transform: translateX(4px);
}

.login-feature-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  background: var(--prime-soft);
  flex-shrink: 0;
}

.login-feature h3 {
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.login-feature p {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.45;
}

.login-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  font-size: 0.84rem;
  color: var(--text-muted);
  width: fit-content;
}

.login-live-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.6);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.login-card-wrap {
  position: relative;
}

.login-card-wrap::before {
  content: '';
  position: absolute;
  inset: -20%;
  background: radial-gradient(circle, var(--prime-glow), transparent 65%);
  pointer-events: none;
  z-index: 0;
}

.login-card {
  position: relative;
  z-index: 1;
  padding: 36px 32px;
  border-radius: 22px;
  border: 1px solid var(--prime-border);
  background: linear-gradient(165deg, rgba(24, 24, 28, 0.95), rgba(12, 12, 14, 0.98));
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.login-card-logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(227, 20, 149, 0.25);
}

.login-card h2 {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.login-card .sub {
  color: var(--text-dim);
  font-size: 0.88rem;
  line-height: 1.55;
  margin-bottom: 28px;
}

.login-card .btn-discord {
  width: 100%;
  justify-content: center;
  padding: 14px 20px;
  font-size: 0.95rem;
}

.login-card-footer {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.login-card-footer a {
  color: var(--text-muted);
  text-decoration: none;
}

.login-card-footer a:hover { color: var(--prime-bright); }

/* ── Dashboard Shell ── */
.dash-shell {
  flex: 1;
  display: flex;
  align-items: flex-start;
  gap: 24px;
  max-width: 1320px;
  margin: 0 auto;
  width: 100%;
  padding: 24px 4% 64px;
}

.dash-sidebar {
  flex: 0 0 260px;
  width: 260px;
  max-width: 260px;
  position: sticky;
  top: 88px;
  padding: 20px 16px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-panel);
}

.dash-sidebar-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0 10px 12px;
}

.dash-nav {
  position: static !important;
  top: auto !important;
  left: auto !important;
  transform: none !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  backdrop-filter: none !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  z-index: auto !important;
  display: flex;
  flex-direction: column !important;
  justify-content: flex-start !important;
  gap: 4px;
}

.dash-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  transition: all 0.15s var(--ease);
}

.dash-nav-btn:hover,
.dash-nav-btn.active {
  background: var(--prime-soft);
  color: var(--text);
}

.dash-nav-btn.active {
  border: 1px solid var(--prime-border);
}

.dash-nav-btn .icon { font-size: 1.05rem; opacity: 0.9; }

.dash-sidebar-user {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.dash-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--prime), #7c3aed);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.dash-sidebar-user .name {
  font-size: 0.88rem;
  font-weight: 700;
}

.dash-sidebar-user .meta {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.dash-content {
  flex: 1 1 0;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.dash-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.dash-topbar h1 {
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  font-weight: 800;
}

.dash-topbar p {
  color: var(--text-dim);
  font-size: 0.88rem;
  margin-top: 4px;
}

.dash-topbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Panels & Cards ── */
.portal-panel {
  padding: 22px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--surface);
  margin-bottom: 20px;
}

.portal-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.portal-panel-head h2 {
  font-size: 1rem;
  font-weight: 700;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
  gap: 14px;
  margin-bottom: 20px;
  min-width: 0;
}

.portal-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.portal-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.portal-grid.wealth-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-card {
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  position: relative;
  overflow: hidden;
  min-width: 0;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 60px;
  height: 60px;
  background: radial-gradient(circle at top right, var(--prime-soft), transparent);
  pointer-events: none;
}

.stat-card.featured {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(227, 20, 149, 0.12), rgba(124, 58, 237, 0.08));
  border-color: var(--prime-border);
}

.stat-card .label {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.stat-card .value {
  font-size: clamp(0.95rem, 1.6vw, 1.55rem);
  font-weight: 800;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-card.featured .value {
  font-size: clamp(1.2rem, 2.4vw, 1.85rem);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.stat-card .sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.stat-card .icon-badge {
  font-size: 1.4rem;
  margin-bottom: 8px;
}

.job-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--prime-soft);
  color: var(--prime-bright);
  border: 1px solid var(--prime-border);
}

/* Character switcher */
.char-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.char-pill {
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.84rem;
  transition: all 0.15s var(--ease);
}

.char-pill.active,
.char-pill:hover {
  border-color: var(--prime-border);
  color: var(--text);
  background: var(--prime-soft);
}

/* Property cards */
.property-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.property-card {
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.property-card:hover {
  border-color: var(--prime-border);
  transform: translateY(-2px);
}

.property-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.property-card h3 { font-size: 1rem; font-weight: 700; }

.property-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  background: var(--surface-soft);
  color: var(--text-muted);
  white-space: nowrap;
}

.property-badge.rent { background: rgba(34, 197, 94, 0.12); color: #86efac; }
.property-badge.own { background: var(--prime-soft); color: var(--prime-bright); }

.property-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.property-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.rent-progress {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  margin: 10px 0 14px;
  overflow: hidden;
}

.rent-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--ok), #4ade80);
  border-radius: 2px;
}

.extend-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.extend-row select {
  flex: 1;
  min-width: 140px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
}

/* ACP tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  font-weight: 600;
}

.data-table tr:hover td { background: rgba(255, 255, 255, 0.02); }

.data-table .mono {
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.status-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

.status-pill.open { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }
.status-pill.progress { background: rgba(234, 179, 8, 0.15); color: #fde68a; }
.status-pill.ok { background: rgba(34, 197, 94, 0.15); color: #86efac; }
.status-pill.urgent { background: rgba(239, 68, 68, 0.2); color: #f87171; }

.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.search-bar input {
  flex: 1;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
}

.player-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: 8px;
  font-size: 0.88rem;
  cursor: pointer;
  transition: border-color 0.15s var(--ease);
}

.player-row:hover { border-color: var(--prime-border); }
.player-row b { color: var(--text); }
.player-row span { color: var(--text-dim); font-size: 0.78rem; }

.player-detail {
  margin-top: 16px;
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--prime-border);
  background: rgba(227, 20, 149, 0.04);
}

.log-timeline { display: flex; flex-direction: column; gap: 8px; }

.log-item {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  align-items: center;
}

.log-item .action {
  font-weight: 700;
  color: var(--prime-bright);
}

.log-item time { color: var(--text-dim); font-size: 0.75rem; }

.dash-tab-panel { display: none; }
.dash-tab-panel.active { display: block; }

.portal-alert {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 20px;
}

.portal-alert.warn {
  border-color: rgba(234, 179, 8, 0.35);
  background: rgba(234, 179, 8, 0.08);
  color: #fde68a;
}

.portal-alert.error {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
  color: #fca5a5;
}

.portal-alert.ok {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.08);
  color: #86efac;
}

.portal-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.portal-loading::before {
  content: '';
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--prime);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.acp-stat-accent.blue { border-color: rgba(59, 130, 246, 0.3); }
.acp-stat-accent.red { border-color: rgba(239, 68, 68, 0.3); }
.acp-stat-accent.green { border-color: rgba(34, 197, 94, 0.3); }

.acp-hero {
  padding: 22px 24px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(59, 130, 246, 0.25);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.14), rgba(227, 20, 149, 0.08));
  margin-bottom: 22px;
}

.acp-hero h2 { font-size: 1.2rem; font-weight: 800; margin-bottom: 6px; }
.acp-hero p { color: var(--text-muted); font-size: 0.88rem; }

.portal-grid.acp-stat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.quick-card {
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: border-color 0.15s var(--ease), transform 0.15s var(--ease);
}

.quick-card:hover {
  border-color: var(--prime-border);
  transform: translateY(-2px);
}

.quick-card strong { display: block; font-size: 0.92rem; margin-bottom: 4px; }
.quick-card span { color: var(--text-dim); font-size: 0.78rem; }

.dash-sidebar.acp-sidebar,
#acpApp .dash-sidebar {
  border-color: rgba(59, 130, 246, 0.22);
}

@media (max-width: 1100px) {
  .portal-grid.acp-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .login-onepager {
    grid-template-columns: 1fr;
    padding-top: 24px;
  }
  .login-showcase { order: 2; }
  .login-card-wrap { order: 1; }
  .dash-shell {
    flex-direction: column;
    padding-top: 16px;
  }
  .dash-sidebar {
    position: static;
    width: 100%;
    max-width: none;
    flex: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
  }
  .dash-sidebar-label,
  .dash-sidebar-user { display: none; }
  .dash-nav {
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
  }
  .dash-nav-btn { width: auto; }
  .portal-grid.cols-2,
  .portal-grid.cols-3,
  .portal-grid.wealth-row { grid-template-columns: 1fr; }
  .log-item { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .extend-row { flex-direction: column; align-items: stretch; }
}
