/* WiseOperations HQ Command Center — Dark Theme Minimalist OS */
:root {
  --bg-base: #0a0e17;
  --bg-surface: #111827;
  --bg-surface-elevated: #1a2234;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(197, 160, 89, 0.4);
  
  --text-main: #f3f4f6;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --gold-accent: #c5a059;
  --gold-glow: rgba(197, 160, 89, 0.15);
  
  --emerald: #10b981;
  --emerald-bg: rgba(16, 185, 129, 0.12);
  --emerald-border: rgba(16, 185, 129, 0.25);
  
  --amber: #f59e0b;
  --amber-bg: rgba(245, 158, 11, 0.12);
  
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background-color: var(--bg-base);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

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

/* ==========================================================================
   Header
   ========================================================================== */
.portal-header {
  height: 64px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-mark {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #c5a059 0%, #987327 100%);
  color: #0a0e17;
  font-weight: 800;
  font-size: 16px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(197, 160, 89, 0.3);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #ffffff;
}

.brand-sub {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--gold-accent);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.system-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
  animation: pulse-ring 2s infinite ease-in-out;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.portal-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-email {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.auth-btn {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  transition: all 0.2s ease;
}

.auth-btn:hover {
  color: #ffffff;
  border-color: var(--gold-accent);
}

/* ==========================================================================
   Main Content
   ========================================================================== */
.portal-main {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 36px 32px 64px 32px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: #ffffff;
}

.section-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.section-badge {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--emerald);
  background: var(--emerald-bg);
  border: 1px solid var(--emerald-border);
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ==========================================================================
   Pulse Section (3 Pillars + Stores)
   ========================================================================== */
.pulse-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 20px;
}

.pulse-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 20px;
}

.card-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--gold-accent);
  margin-bottom: 14px;
}

/* Pillars List */
.pillars-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pillar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
}

.pillar-icon {
  font-size: 18px;
}

.pillar-info {
  flex: 1;
}

.pillar-name {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
}

.pillar-desc {
  font-size: 11px;
  color: var(--text-dim);
}

.pillar-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-family: var(--font-mono);
}

.pillar-status.online {
  color: var(--emerald);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald);
}

/* Stores List */
.stores-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.store-chip {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.store-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.store-num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--gold-accent);
}

.store-status-pill {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--emerald-bg);
  color: var(--emerald);
  border: 1px solid var(--emerald-border);
}

.store-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.store-brand {
  font-size: 11px;
  color: var(--text-dim);
}

.loading-placeholder {
  color: var(--text-dim);
  font-size: 12px;
  padding: 16px 0;
}

/* ==========================================================================
   Tools Matrix
   ========================================================================== */
.tool-count-badge {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--gold-accent);
  background: var(--gold-glow);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(197, 160, 89, 0.3);
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.tool-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 20px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.tool-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-surface-elevated);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.tool-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.tool-card-icon {
  font-size: 26px;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tool-card-status {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 4px;
}

.tool-card-status.live {
  background: var(--emerald-bg);
  color: var(--emerald);
  border: 1px solid var(--emerald-border);
}

.tool-card-name {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 6px;
}

.tool-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
}

.tool-card-footer {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tool-card-url {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gold-accent);
}

.tool-card-arrow {
  color: var(--text-dim);
  font-size: 14px;
  transition: transform 0.2s ease;
}

.tool-card:hover .tool-card-arrow {
  transform: translateX(4px);
  color: var(--gold-accent);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.portal-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-dim);
  background: var(--bg-surface);
}

.footer-left, .footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-divider {
  color: var(--border-subtle);
}

@media (max-width: 860px) {
  .pulse-grid {
    grid-template-columns: 1fr;
  }
  .portal-header {
    padding: 0 16px;
  }
  .portal-main {
    padding: 24px 16px;
  }
}