:root {
    --bg-main: #0a0e17;
    --bg-surface: rgba(17, 24, 39, 0.75);
    --bg-surface-hover: rgba(31, 41, 55, 0.85);
    --bg-surface-solid: #111827;
    --bg-card: rgba(20, 30, 48, 0.6);
    --bg-card-hover: rgba(28, 42, 68, 0.8);
    
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(56, 189, 248, 0.3);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-cyan: #38bdf8;
    --accent-blue: #3b82f6;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-purple: #a855f7;
    --accent-teal: #14b8a6;
    
    --glow-cyan: rgba(56, 189, 248, 0.2);
    --glow-blue: rgba(59, 130, 246, 0.2);
    
    --font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-family);
    min-height: 100vh;
    line-height: 1.5;
    position: relative;
    overflow-x: hidden;
}

/* Background Ambient Glows */
.background-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
}

.glow-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(2, 132, 199, 0.15), transparent 70%);
    top: -100px;
    left: -100px;
}

.glow-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.1), transparent 70%);
    bottom: -150px;
    right: -150px;
}

.app-container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

/* Header */
.hub-header {
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 1.75rem 2rem;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.25rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-logo {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #0284c7, #38bdf8);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}

.logo-icon {
    font-size: 1.5rem;
}

.brand-text h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.accent-text {
    background: linear-gradient(135deg, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tagline {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.user-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.82rem;
}

.user-pill.logged-in {
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.3);
}

.user-name {
    color: var(--text-secondary);
    font-weight: 500;
}

.user-pill.logged-in .user-name {
    color: var(--accent-cyan);
    font-weight: 600;
}

.btn-auth-action {
    background: linear-gradient(135deg, #0284c7, #38bdf8);
    color: #04142b;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.75rem;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
    transition: transform 0.15s ease;
}

.btn-auth-action:hover {
    transform: scale(1.05);
}

.btn-auth-logout {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
}

.system-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
}

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

.status-dot.pulse {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.status-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #6ee7b7;
}

.live-clock {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-left: 1px solid rgba(16, 185, 129, 0.3);
    padding-left: 0.75rem;
}

/* Info Bar */
.info-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
}

.info-icon {
    font-size: 1.35rem;
}

.info-content {
    display: flex;
    flex-direction: column;
}

.info-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.info-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.highlight-crun {
    color: #38bdf8;
}

.highlight-domain {
    color: #c084fc;
    font-weight: 700;
}

/* Main Area */
.section-title-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-title-wrap h2 {
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.section-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    width: 260px;
}

.search-box input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    width: 100%;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

/* Tiles Grid */
.tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.hub-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.25rem;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #0284c7, #38bdf8, #818cf8);
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.hub-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-highlight);
    box-shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.6), 0 0 15px var(--glow-cyan);
}

.active-card {
    cursor: pointer;
}

.planned-card {
    opacity: 0.75;
    border-style: dashed;
}

.planned-card:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-icon {
    font-size: 1.35rem;
}

.icon-cyan { background: rgba(56, 189, 248, 0.15); border: 1px solid rgba(56, 189, 248, 0.3); }
.icon-amber { background: rgba(245, 158, 11, 0.15); border: 1px solid rgba(245, 158, 11, 0.3); }
.icon-purple { background: rgba(168, 85, 247, 0.15); border: 1px solid rgba(168, 85, 247, 0.3); }
.icon-emerald { background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.3); }
.icon-blue { background: rgba(59, 130, 246, 0.15); border: 1px solid rgba(59, 130, 246, 0.3); }
.icon-teal { background: rgba(20, 184, 166, 0.15); border: 1px solid rgba(20, 184, 166, 0.3); }

.badge {
    font-size: 0.725rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-online {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-planned {
    background: rgba(100, 116, 139, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(100, 116, 139, 0.3);
}

.card-body h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.card-body p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.8rem;
}

.footer-action {
    color: var(--accent-cyan);
    font-weight: 600;
}

.footer-status {
    color: var(--text-muted);
    font-weight: 500;
}

.footer-meta {
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Architecture Section */
.architecture-section {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 2rem;
}

.arch-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-top: 1.25rem;
}

.arch-step {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 1.25rem;
    position: relative;
}

.step-num {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-cyan);
    margin-bottom: 0.5rem;
}

.arch-step h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.arch-step p {
    font-size: 0.825rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.arch-step code {
    font-family: var(--font-mono);
    background: rgba(255, 255, 255, 0.08);
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
    color: #e2e8f0;
}

/* Footer */
.hub-footer {
    border-top: 1px solid var(--border-subtle);
    padding-top: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.hub-footer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.hub-footer a:hover {
    color: var(--accent-cyan);
    text-decoration: underline;
}

.footer-sub {
    font-size: 0.78rem;
    margin-top: 0.25rem;
}

.card-footer-multi {
    display: flex;
    gap: 0.6rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
}

.action-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.action-demo {
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #38bdf8;
}

.action-demo:hover,
.hub-card:hover .action-demo {
    background: rgba(56, 189, 248, 0.28);
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.4);
    color: #ffffff;
}

.hub-card:hover .footer-action {
    color: #38bdf8;
}

.action-full {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

.action-full:hover,
.hub-card:hover .action-full {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.dashboard-zone {
    margin-bottom: 2rem;
}

.section-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.section-title-icon {
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.zone-divider {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin: 2.5rem 0 1.5rem 0;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-subtle), transparent);
}

.divider-text {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.35rem 1rem;
    border-radius: 9999px;
    border: 1px solid var(--border-subtle);
}

.card-unlocked {
    border-color: rgba(56, 189, 248, 0.35);
    background: rgba(12, 19, 34, 0.85);
}

.card-unlocked:hover {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 25px rgba(56, 189, 248, 0.25);
}

.card-admin {
    border-color: rgba(52, 211, 153, 0.4);
    background: rgba(12, 28, 24, 0.85);
}

.card-admin:hover {
    border-color: #34d399;
    box-shadow: 0 0 25px rgba(52, 211, 153, 0.3);
}

.badge-unlocked {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.35);
}

.badge-admin {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.4);
}

.badge-passkey-required {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.4);
}

.btn-profile-pill {
    background: rgba(56, 189, 248, 0.15);
    color: var(--accent-cyan);
    border: 1px solid rgba(56, 189, 248, 0.3);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.78rem;
    padding: 0.3rem 0.75rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s ease;
}

.btn-profile-pill:hover {
    background: rgba(56, 189, 248, 0.25);
    color: #fff;
    transform: translateY(-1px);
}

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        padding: 1rem;
        gap: 1.5rem;
    }
    
    .hub-header {
        padding: 1.25rem;
    }
    
    .brand-text h1 {
        font-size: 1.4rem;
    }
    
    .tiles-grid {
        grid-template-columns: 1fr;
    }
}
