/* ═══════════════════════════════════════════════════════════════════════════
   MNMS OS — Design System 2277
   "The platform that thinks, connects, and grows with you."
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;600;700;800;900&family=Space+Grotesk:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Design Tokens ─────────────────────────────────────────────────────────── */
:root {
    /* Backgrounds — deep space */
    --bg:             #03030a;
    --bg-mid:         #06060f;
    --surface:        #0c0c18;
    --surface2:       #10101e;
    --surface3:       #141428;
    --surface-glass:  rgba(12,12,24,0.75);
    --surface-hover:  rgba(255,255,255,0.04);

    /* Borders */
    --border:         rgba(255,255,255,0.07);
    --border-bright:  rgba(0,212,255,0.3);
    --border-hover:   rgba(0,212,255,0.5);

    /* Accent palette */
    --cyan:           #00d4ff;
    --cyan-dim:       rgba(0,212,255,0.12);
    --cyan-glow:      rgba(0,212,255,0.25);
    --cyan-deep:      #0088aa;
    --violet:         #7c3aed;
    --violet-bright:  #a855f7;
    --violet-dim:     rgba(168,85,247,0.12);
    --green:          #22c55e;
    --green-dim:      rgba(34,197,94,0.12);
    --green-glow:     rgba(34,197,94,0.3);
    --amber:          #f59e0b;
    --amber-dim:      rgba(245,158,11,0.12);
    --red:            #ef4444;
    --red-dim:        rgba(239,68,68,0.12);
    --pink:           #ec4899;

    /* Keep accent pointing to cyan as primary */
    --accent:         var(--cyan);
    --accent-dim:     var(--cyan-dim);
    --purple:         var(--violet-bright);

    /* Typography */
    --text:           #e8e8f4;
    --text-secondary: #8888aa;
    --text-muted:     #44445a;
    --font:           'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display:   'Orbitron', 'Space Grotesk', sans-serif;
    --font-mono:      'JetBrains Mono', 'Fira Code', monospace;

    /* Layout */
    --sidebar-w:      260px;
    --radius-sm:      8px;
    --radius:         12px;
    --radius-lg:      18px;
    --radius-xl:      24px;

    /* Shadows */
    --shadow-sm:      0 2px 8px rgba(0,0,0,0.4);
    --shadow:         0 4px 24px rgba(0,0,0,0.5);
    --shadow-lg:      0 8px 48px rgba(0,0,0,0.7);
    --shadow-cyan:    0 0 24px rgba(0,212,255,0.2), 0 0 48px rgba(0,212,255,0.08);
    --shadow-green:   0 0 20px rgba(34,197,94,0.25);
    --shadow-violet:  0 0 24px rgba(168,85,247,0.2);

    /* Transitions */
    --ease:           cubic-bezier(0.22, 1, 0.36, 1);
    --ease-spring:    cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --t-fast:         0.12s var(--ease);
    --t:              0.22s var(--ease);
    --t-slow:         0.4s var(--ease);
}

/* ── Reset & Base ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html, body {
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ── Animated Background Grid ───────────────────────────────────────────────── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(0,212,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,212,255,0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
    animation: grid-drift 30s linear infinite;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 20% 20%, rgba(124,58,237,0.06) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 80% 80%, rgba(0,212,255,0.05) 0%, transparent 60%),
        radial-gradient(ellipse 40% 30% at 50% 50%, rgba(34,197,94,0.02) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

@keyframes grid-drift {
    0%   { transform: translate(0,0); }
    100% { transform: translate(60px, 60px); }
}

/* Make sure content sits above the background layers */
.sidebar, .main-content, .auth-wrap { position: relative; z-index: 1; }

/* ── Keyframe Library ───────────────────────────────────────────────────────── */

/* Pulse glow — used on status dots, active states */
@keyframes pulse-cyan {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0,212,255,0.5); }
    50%       { box-shadow: 0 0 0 6px rgba(0,212,255,0); }
}
@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.5); }
    50%       { box-shadow: 0 0 0 6px rgba(34,197,94,0); }
}
@keyframes pulse-amber {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245,158,11,0.5); }
    50%       { box-shadow: 0 0 0 6px rgba(245,158,11,0); }
}

/* Holographic shimmer — premium elements */
@keyframes holo-shimmer {
    0%   { background-position: -200% center; }
    100% { background-position: 200% center; }
}

/* Slide in from bottom — toasts, modals */
@keyframes slide-up {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Fade scale in — cards, tooltips */
@keyframes fade-scale-in {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

/* Connection line draw — module canvas wires */
@keyframes wire-draw {
    from { stroke-dashoffset: 1000; }
    to   { stroke-dashoffset: 0; }
}

/* Wire color transition: gray → cyan → green flash → cyan */
@keyframes wire-connect {
    0%   { stroke: rgba(255,255,255,0.2); filter: none; }
    40%  { stroke: #00d4ff; filter: drop-shadow(0 0 4px #00d4ff); }
    70%  { stroke: #22c55e; filter: drop-shadow(0 0 8px #22c55e); }
    100% { stroke: #00d4ff; filter: drop-shadow(0 0 4px rgba(0,212,255,0.6)); }
}

/* Port pulse — module ports waiting for connection */
@keyframes port-pulse {
    0%, 100% { transform: scale(1);    opacity: 1; }
    50%       { transform: scale(1.4); opacity: 0.7; }
}

/* Celebration confetti drop */
@keyframes confetti-fall {
    0%   { transform: translateY(-20px) rotate(0deg);   opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* Orbit spin — loading indicator */
@keyframes orbit {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Number count up — stat values */
@keyframes count-up {
    from { transform: translateY(6px); opacity: 0; }
    to   { transform: translateY(0);   opacity: 1; }
}

/* Border glow sweep */
@keyframes border-sweep {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Tooltip appear */
@keyframes tooltip-in {
    from { opacity: 0; transform: translateY(4px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Scrollbar ──────────────────────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,212,255,0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,212,255,0.4); }

/* ── Glassmorphism Base ─────────────────────────────────────────────────────── */
.glass {
    background: var(--surface-glass);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border: 1px solid var(--border);
}

/* ── Sidebar ────────────────────────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--surface-glass);
    backdrop-filter: blur(24px) saturate(1.5);
    -webkit-backdrop-filter: blur(24px) saturate(1.5);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 0 0 20px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 4px 0 32px rgba(0,0,0,0.5);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 26px 22px 22px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}

.logo-mark {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, var(--cyan), var(--violet-bright));
    color: #fff;
    font-weight: 900;
    font-size: 12px;
    font-family: var(--font-display);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    box-shadow: var(--shadow-cyan);
    letter-spacing: 0.5px;
}

.logo-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    background: linear-gradient(90deg, var(--cyan), var(--violet-bright));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-tenant {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 155px;
    margin-top: 1px;
}

.nav-section { padding: 4px 12px 8px; }

.nav-label {
    font-size: 9px;
    font-weight: 700;
    font-family: var(--font-display);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 10px 10px 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    transition: all var(--t-fast);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0; top: 0;
    width: 3px; height: 100%;
    background: var(--cyan);
    border-radius: 0 2px 2px 0;
    transform: scaleY(0);
    transition: transform var(--t-fast);
}

.nav-item:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.nav-item.active {
    background: var(--cyan-dim);
    color: var(--cyan);
}

.nav-item.active::before {
    transform: scaleY(1);
}

.nav-item.nav-logout:hover { color: var(--red); }
.nav-icon { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }

/* Status dot on nav items */
.nav-status {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--green);
    margin-left: auto;
    animation: pulse-green 2s ease-in-out infinite;
    flex-shrink: 0;
}

.badge-trial {
    margin-left: auto;
    background: var(--amber-dim);
    color: var(--amber);
    font-size: 10px;
    font-weight: 700;
    font-family: var(--font-display);
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    border: 1px solid rgba(245,158,11,0.2);
}

/* ── Main Content ───────────────────────────────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-w);
    padding: 36px 40px;
    min-height: 100vh;
}

/* ── Trial Banner ───────────────────────────────────────────────────────────── */
.trial-banner {
    background: linear-gradient(135deg, rgba(245,158,11,0.06), rgba(245,158,11,0.03));
    border: 1px solid rgba(245,158,11,0.2);
    border-radius: var(--radius);
    padding: 13px 20px;
    margin-bottom: 28px;
    font-size: 13px;
    color: var(--amber);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slide-up 0.3s var(--ease);
}

.trial-banner a {
    color: var(--cyan);
    margin-left: auto;
    font-weight: 600;
    font-size: 12px;
    padding: 5px 14px;
    border: 1px solid rgba(0,212,255,0.3);
    border-radius: 20px;
    transition: all var(--t-fast);
}
.trial-banner a:hover {
    background: var(--cyan-dim);
    border-color: var(--cyan);
}

/* ── Page Header ────────────────────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 32px;
    animation: slide-up 0.25s var(--ease);
}

.page-header h1 {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.page-header h1 span { color: var(--cyan); }

.page-sub {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 400;
}

/* ── Stats Grid ─────────────────────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    transition: all var(--t);
    animation: fade-scale-in 0.3s var(--ease) both;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0,212,255,0.4), transparent);
    opacity: 0;
    transition: opacity var(--t);
}

.stat-card:hover {
    border-color: rgba(0,212,255,0.25);
    transform: translateY(-2px);
    box-shadow: var(--shadow-cyan);
}

.stat-card:hover::after { opacity: 1; }

.stat-card.amber:hover {
    border-color: rgba(245,158,11,0.35);
    box-shadow: 0 0 24px rgba(245,158,11,0.15);
}

.stat-label {
    font-size: 10px;
    font-weight: 700;
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text);
    line-height: 1;
    animation: count-up 0.4s var(--ease);
}

.stat-value.accent { color: var(--cyan); }
.stat-card.amber .stat-value { color: var(--amber); }
.stat-sub { font-size: 11px; color: var(--text-muted); margin-top: 6px; }

/* ── Cards ──────────────────────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    overflow: hidden;
    transition: border-color var(--t);
}

.card:hover { border-color: rgba(0,212,255,0.15); }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 14px;
    font-family: var(--font-display);
    letter-spacing: 0.3px;
    background: linear-gradient(180deg, var(--surface2), var(--surface));
}

/* ── Glassmorphism Card variant ─────────────────────────────────────────────── */
.card-glass {
    background: var(--surface-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    overflow: hidden;
}

/* ── Tables ─────────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

thead th {
    padding: 11px 18px;
    font-size: 10px;
    font-weight: 700;
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    text-align: left;
    background: var(--surface2);
    white-space: nowrap;
}

tbody td {
    padding: 13px 18px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    vertical-align: middle;
    transition: background var(--t-fast);
}

tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--t-fast); }
tbody tr:hover td {
    background: rgba(0,212,255,0.03);
}

/* ── Badges ─────────────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border: 1px solid transparent;
}

.badge-green  { background: var(--green-dim);   color: var(--green);          border-color: rgba(34,197,94,0.2); }
.badge-accent { background: var(--cyan-dim);    color: var(--cyan);            border-color: rgba(0,212,255,0.2); }
.badge-amber  { background: var(--amber-dim);   color: var(--amber);           border-color: rgba(245,158,11,0.2); }
.badge-red    { background: var(--red-dim);     color: var(--red);             border-color: rgba(239,68,68,0.2); }
.badge-purple { background: var(--violet-dim);  color: var(--violet-bright);   border-color: rgba(168,85,247,0.2); }

/* Live indicator badge */
.badge-live {
    background: var(--green-dim);
    color: var(--green);
    border-color: rgba(34,197,94,0.2);
}
.badge-live::before {
    content: '';
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--green);
    display: inline-block;
    animation: pulse-green 2s ease-in-out infinite;
}

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--t-fast);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: 0.2px;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
    opacity: 0;
    transition: opacity var(--t-fast);
}

.btn:hover::after { opacity: 1; }
.btn:active { transform: scale(0.97); }

/* Primary — cyan with glow */
.btn-primary {
    background: var(--cyan);
    color: #000;
    border-color: var(--cyan);
    font-weight: 700;
    box-shadow: 0 0 16px rgba(0,212,255,0.3);
}
.btn-primary:hover {
    background: #00eeff;
    box-shadow: 0 0 28px rgba(0,212,255,0.5);
    transform: translateY(-1px);
}

/* Ghost — outline style */
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
}
.btn-ghost:hover {
    border-color: var(--cyan);
    color: var(--cyan);
    background: var(--cyan-dim);
}

/* Green — success action */
.btn-green {
    background: var(--green-dim);
    color: var(--green);
    border-color: rgba(34,197,94,0.3);
}
.btn-green:hover {
    box-shadow: var(--shadow-green);
    border-color: var(--green);
    transform: translateY(-1px);
}

/* Violet — premium/marketplace */
.btn-violet {
    background: var(--violet-dim);
    color: var(--violet-bright);
    border-color: rgba(168,85,247,0.3);
}
.btn-violet:hover {
    box-shadow: var(--shadow-violet);
    border-color: var(--violet-bright);
    transform: translateY(-1px);
}

/* Danger */
.btn-danger {
    background: var(--red-dim);
    color: var(--red);
    border-color: rgba(239,68,68,0.3);
}
.btn-danger:hover { border-color: var(--red); }

/* Sizes */
.btn-sm   { padding: 6px 14px; font-size: 12px; }
.btn-lg   { padding: 13px 28px; font-size: 15px; font-weight: 700; }
.btn-icon { padding: 8px; border-radius: 8px; }

/* Holographic premium button */
.btn-holo {
    background: linear-gradient(135deg,
        rgba(0,212,255,0.15),
        rgba(168,85,247,0.15),
        rgba(0,212,255,0.15));
    background-size: 200% auto;
    color: var(--cyan);
    border: 1px solid rgba(0,212,255,0.3);
    animation: border-sweep 4s linear infinite;
}
.btn-holo:hover {
    background-size: 200% auto;
    box-shadow: var(--shadow-cyan);
    border-color: var(--cyan);
}

/* ── Forms ──────────────────────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-display);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.form-label .required {
    color: var(--red);
    font-size: 14px;
    line-height: 1;
}

input, select, textarea {
    width: 100%;
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    font-size: 14px;
    font-family: var(--font);
    transition: all var(--t-fast);
    appearance: none;
    -webkit-appearance: none;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--cyan);
    background: rgba(0,212,255,0.03);
    box-shadow: 0 0 0 3px rgba(0,212,255,0.08), 0 0 16px rgba(0,212,255,0.1);
}

input::placeholder, textarea::placeholder {
    color: var(--text-muted);
    font-size: 13px;
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2344445a' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    cursor: pointer;
}

select option { background: var(--surface2); color: var(--text); }

textarea { resize: vertical; min-height: 90px; }

.form-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 5px;
    line-height: 1.4;
}

.form-error {
    font-size: 11px;
    color: var(--red);
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Input with icon prefix */
.input-wrap {
    position: relative;
}
.input-wrap .input-icon {
    position: absolute;
    left: 12px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    font-size: 15px;
}
.input-wrap input { padding-left: 40px; }

/* ── (i) Help Tooltip System ────────────────────────────────────────────────── */
.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: rgba(0,212,255,0.1);
    border: 1px solid rgba(0,212,255,0.25);
    color: var(--cyan);
    font-size: 9px;
    font-weight: 700;
    font-family: var(--font-display);
    cursor: pointer;
    transition: all var(--t-fast);
    position: relative;
    flex-shrink: 0;
    user-select: none;
}

.help-icon:hover {
    background: rgba(0,212,255,0.2);
    border-color: var(--cyan);
    box-shadow: 0 0 8px rgba(0,212,255,0.3);
    transform: scale(1.15);
}

.help-tooltip {
    position: absolute;
    z-index: 1000;
    background: var(--surface2);
    border: 1px solid rgba(0,212,255,0.3);
    border-radius: var(--radius);
    padding: 14px 16px;
    min-width: 260px;
    max-width: 320px;
    box-shadow: var(--shadow), 0 0 24px rgba(0,212,255,0.1);
    animation: tooltip-in 0.18s var(--ease);
    pointer-events: none;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
}

/* Caret */
.help-tooltip::after {
    content: '';
    position: absolute;
    top: 100%; left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0,212,255,0.3);
}

.help-tooltip-title {
    font-size: 11px;
    font-weight: 700;
    font-family: var(--font-display);
    color: var(--cyan);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.help-tooltip-body {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 8px;
}

.help-tooltip-example {
    font-size: 11px;
    color: var(--text-muted);
    background: rgba(0,0,0,0.3);
    border-left: 2px solid var(--cyan);
    padding: 6px 10px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
    line-height: 1.4;
}

/* ── Onboarding Card ────────────────────────────────────────────────────────── */
.onboarding-card {
    background: linear-gradient(135deg,
        rgba(0,212,255,0.04),
        rgba(124,58,237,0.04),
        rgba(0,212,255,0.02));
    border: 1px solid rgba(0,212,255,0.15);
    border-radius: var(--radius-xl);
    padding: 28px;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
}

.onboarding-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--cyan), var(--violet-bright), transparent);
}

.ob-progress-bar {
    height: 3px;
    background: var(--surface2);
    border-radius: 2px;
    margin-bottom: 20px;
    overflow: hidden;
}

.ob-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--cyan), var(--violet-bright));
    border-radius: 2px;
    transition: width 0.6s var(--ease);
    box-shadow: 0 0 8px rgba(0,212,255,0.5);
}

.ob-checklist { display: flex; flex-direction: column; gap: 8px; }

.ob-check {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--t-fast);
}

.ob-check:hover:not(.done) {
    border-color: rgba(0,212,255,0.3);
    color: var(--text);
    background: rgba(0,212,255,0.03);
    transform: translateX(3px);
}

.ob-check.done { color: var(--text-muted); }
.ob-check.done .check-icon { color: var(--green); }
.check-icon { font-size: 15px; color: var(--text-muted); width: 20px; text-align: center; flex-shrink: 0; }

/* ── Status Indicators ──────────────────────────────────────────────────────── */
.status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.status-dot.green  { background: var(--green);  animation: pulse-green 2s ease-in-out infinite; }
.status-dot.cyan   { background: var(--cyan);   animation: pulse-cyan  2s ease-in-out infinite; }
.status-dot.amber  { background: var(--amber);  animation: pulse-amber 2s ease-in-out infinite; }
.status-dot.red    { background: var(--red); }
.status-dot.gray   { background: var(--text-muted); }

/* ── Module Cards (Workspace + Marketplace) ─────────────────────────────────── */
.mod-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all var(--t);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.mod-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0,212,255,0.05), transparent);
    opacity: 0;
    transition: opacity var(--t);
}

.mod-card:hover {
    border-color: rgba(0,212,255,0.3);
    transform: translateY(-3px);
    box-shadow: var(--shadow-cyan);
}
.mod-card:hover::before { opacity: 1; }

.mod-card.active {
    border-color: rgba(34,197,94,0.35);
    background: linear-gradient(135deg, rgba(34,197,94,0.04), var(--surface));
}

.mod-card.active::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--green), var(--cyan));
}

.mod-card .mod-icon {
    font-size: 28px;
    margin-bottom: 12px;
    display: block;
    filter: drop-shadow(0 0 8px rgba(0,212,255,0.3));
}

.mod-card .mod-name {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
}

.mod-card .mod-desc {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.5;
}

.mod-card .mod-badge {
    position: absolute;
    top: 12px; right: 12px;
}

/* Recommended badge — holographic shimmer */
.badge-recommended {
    background: linear-gradient(135deg,
        rgba(0,212,255,0.2),
        rgba(168,85,247,0.2),
        rgba(0,212,255,0.2));
    background-size: 200% auto;
    color: var(--cyan);
    border: 1px solid rgba(0,212,255,0.3);
    animation: holo-shimmer 3s linear infinite;
    font-size: 9px;
    font-weight: 700;
    font-family: var(--font-display);
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* ── Connection Animation (Module Canvas) ───────────────────────────────────── */
.connector-port {
    width: 10px; height: 10px;
    border-radius: 50%;
    border: 2px solid rgba(0,212,255,0.4);
    background: rgba(0,212,255,0.1);
    cursor: crosshair;
    transition: all var(--t-fast);
}

.connector-port:hover,
.connector-port.active {
    border-color: var(--cyan);
    background: var(--cyan-dim);
    animation: port-pulse 1.2s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(0,212,255,0.5);
}

.connector-port.fulfilled {
    border-color: var(--green);
    background: var(--green-dim);
    animation: pulse-green 2s ease-in-out infinite;
}

.connector-port.unfulfilled {
    border-color: var(--amber);
    background: var(--amber-dim);
    animation: pulse-amber 1.5s ease-in-out infinite;
}

/* SVG connection lines */
.connection-line {
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    stroke-width: 2;
    transition: stroke 0.8s var(--ease), filter 0.8s var(--ease);
}

.connection-line.connecting {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: wire-draw 0.6s var(--ease) forwards;
}

.connection-line.new-connection {
    animation: wire-connect 1.5s var(--ease) forwards;
}

.connection-line.fulfilled {
    stroke: var(--cyan);
    filter: drop-shadow(0 0 3px rgba(0,212,255,0.6));
}

.connection-line.unfulfilled {
    stroke: rgba(255,255,255,0.15);
    stroke-dasharray: 6 4;
}

/* Canvas node card */
.canvas-node {
    position: absolute;
    background: var(--surface-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    min-width: 140px;
    cursor: grab;
    user-select: none;
    transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
    animation: fade-scale-in 0.25s var(--ease-spring);
}

.canvas-node:hover {
    border-color: rgba(0,212,255,0.4);
    box-shadow: var(--shadow-cyan);
    z-index: 10;
}

.canvas-node.connected {
    border-color: rgba(34,197,94,0.4);
    box-shadow: var(--shadow-green);
}

.canvas-node.dragging {
    cursor: grabbing;
    transform: scale(1.04);
    box-shadow: var(--shadow-lg), var(--shadow-cyan);
    z-index: 100;
}

/* ── Marketplace ────────────────────────────────────────────────────────────── */
.marketplace-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.market-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--t);
    position: relative;
}

.market-card:hover {
    border-color: rgba(0,212,255,0.25);
    transform: translateY(-4px);
    box-shadow: var(--shadow-cyan);
}

.market-card-header {
    padding: 22px 22px 16px;
    background: linear-gradient(135deg, rgba(0,212,255,0.04), transparent);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.market-icon {
    font-size: 32px;
    filter: drop-shadow(0 0 10px rgba(0,212,255,0.3));
    flex-shrink: 0;
}

.market-card-body { padding: 16px 22px 20px; }

.market-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.market-rating {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    color: var(--amber);
    font-weight: 600;
}

.market-installs {
    font-size: 11px;
    color: var(--text-muted);
}

.market-price {
    margin-left: auto;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    color: var(--cyan);
}

.market-price.free { color: var(--green); }

/* ── Smart Suggestion Card ──────────────────────────────────────────────────── */
.suggestion-card {
    background: linear-gradient(135deg, rgba(168,85,247,0.06), rgba(0,212,255,0.04));
    border: 1px solid rgba(168,85,247,0.2);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    transition: all var(--t-fast);
    animation: slide-up 0.3s var(--ease);
}

.suggestion-card:hover {
    border-color: rgba(168,85,247,0.4);
    transform: translateX(3px);
}

.suggestion-icon { font-size: 22px; flex-shrink: 0; margin-top: 2px; }

.suggestion-title {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 3px;
}

.suggestion-desc {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ── Bundle/Starter Pack Card ───────────────────────────────────────────────── */
.bundle-card {
    background: linear-gradient(135deg,
        rgba(0,212,255,0.05),
        rgba(168,85,247,0.05),
        rgba(34,197,94,0.03));
    border: 1px solid rgba(0,212,255,0.2);
    border-radius: var(--radius-xl);
    padding: 28px;
    position: relative;
    overflow: hidden;
    transition: all var(--t);
}

.bundle-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--cyan), var(--violet-bright), var(--green));
}

.bundle-card:hover {
    border-color: rgba(0,212,255,0.4);
    transform: translateY(-4px);
    box-shadow: 0 12px 48px rgba(0,0,0,0.5), var(--shadow-cyan);
}

.bundle-modules {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 14px 0;
}

.bundle-module-chip {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 11px;
    color: var(--text-secondary);
}

/* ── Empty State ────────────────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 64px 40px;
    color: var(--text-secondary);
    animation: fade-scale-in 0.3s var(--ease);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
    display: block;
    filter: drop-shadow(0 0 16px rgba(0,212,255,0.2));
}

.empty-state h3 {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.empty-state p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* ── Toast Notifications ────────────────────────────────────────────────────── */
#toast-container {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    max-width: 360px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-lg);
    animation: slide-up 0.25s var(--ease-spring);
    border: 1px solid transparent;
}

.toast.success {
    background: rgba(34,197,94,0.12);
    border-color: rgba(34,197,94,0.3);
    color: var(--green);
}

.toast.error {
    background: rgba(239,68,68,0.12);
    border-color: rgba(239,68,68,0.3);
    color: var(--red);
}

.toast.info {
    background: rgba(0,212,255,0.08);
    border-color: rgba(0,212,255,0.2);
    color: var(--cyan);
}

.toast.warning {
    background: rgba(245,158,11,0.08);
    border-color: rgba(245,158,11,0.2);
    color: var(--amber);
}

.toast-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.toast-body { flex: 1; line-height: 1.4; }
.toast-title { font-weight: 700; margin-bottom: 2px; }
.toast-msg { font-size: 12px; opacity: 0.8; }

/* ── Auth Pages (Login / Signup) ────────────────────────────────────────────── */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.auth-card {
    width: 100%;
    max-width: 480px;
    background: var(--surface-glass);
    backdrop-filter: blur(32px) saturate(1.5);
    -webkit-backdrop-filter: blur(32px) saturate(1.5);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 44px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg), 0 0 60px rgba(0,212,255,0.06);
    animation: fade-scale-in 0.4s var(--ease-spring);
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--cyan), var(--violet-bright), var(--cyan), transparent);
    animation: border-sweep 4s linear infinite;
    background-size: 200% auto;
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px; height: 60px;
    background: linear-gradient(135deg, var(--cyan), var(--violet-bright));
    border-radius: 16px;
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 900;
    color: #fff;
    letter-spacing: 1px;
    box-shadow: var(--shadow-cyan), var(--shadow-violet);
    margin-bottom: 16px;
}

.auth-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 1px;
    background: linear-gradient(90deg, var(--cyan), var(--violet-bright));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

/* Signup step indicator */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 32px;
}

.step-dot {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    font-family: var(--font-display);
    border: 1px solid var(--border);
    color: var(--text-muted);
    background: var(--surface2);
    transition: all var(--t);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.step-dot.active {
    border-color: var(--cyan);
    color: var(--cyan);
    background: var(--cyan-dim);
    box-shadow: 0 0 16px rgba(0,212,255,0.3);
}

.step-dot.done {
    border-color: var(--green);
    color: #000;
    background: var(--green);
}

.step-line {
    flex: 1;
    height: 1px;
    background: var(--border);
    max-width: 60px;
    transition: background var(--t);
}

.step-line.done { background: var(--green); }

/* ── Q-item (Profile questionnaire checkboxes) ──────────────────────────────── */
.q-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.q-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--t-fast);
    user-select: none;
    position: relative;
}

.q-item:hover {
    border-color: rgba(0,212,255,0.3);
    background: rgba(0,212,255,0.03);
}

.q-item.selected {
    border-color: rgba(0,212,255,0.5);
    background: rgba(0,212,255,0.06);
}

.q-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0; height: 0;
}

.q-check-box {
    width: 20px; height: 20px;
    border-radius: 5px;
    border: 1.5px solid var(--border);
    background: rgba(0,0,0,0.4);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
    transition: all var(--t-fast);
    font-size: 11px;
    color: transparent;
}

.q-item.selected .q-check-box {
    border-color: var(--cyan);
    background: var(--cyan);
    color: #000;
    font-weight: 900;
    box-shadow: 0 0 10px rgba(0,212,255,0.4);
}

.q-item-icon { font-size: 22px; flex-shrink: 0; margin-top: 1px; }
.q-item-text { flex: 1; }

.q-item-label {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 3px;
}

.q-item-sub {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ── Celebration / Confetti ─────────────────────────────────────────────────── */
.confetti-piece {
    position: fixed;
    width: 8px; height: 8px;
    pointer-events: none;
    z-index: 9999;
    border-radius: 2px;
    animation: confetti-fall 3s ease-in forwards;
}

/* ── Loading Skeleton ───────────────────────────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg,
        var(--surface2) 25%,
        var(--surface3) 50%,
        var(--surface2) 75%);
    background-size: 200% 100%;
    animation: holo-shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

/* ── Divider ────────────────────────────────────────────────────────────────── */
.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
    margin: 24px 0;
}

.divider-text {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 11px;
    margin: 20px 0;
}
.divider-text::before, .divider-text::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ── Modals ─────────────────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fade-scale-in 0.15s var(--ease);
}

.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 32px;
    width: 100%;
    max-width: 520px;
    box-shadow: var(--shadow-lg);
    animation: slide-up 0.25s var(--ease-spring);
    position: relative;
    overflow: hidden;
}

.modal::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--cyan), transparent);
}

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

.modal-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.modal-close {
    width: 32px; height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all var(--t-fast);
}
.modal-close:hover { border-color: var(--red); color: var(--red); }

/* ── Connection Success Overlay (module canvas) ─────────────────────────────── */
.connection-success {
    position: absolute;
    background: rgba(34,197,94,0.1);
    border: 1px solid rgba(34,197,94,0.4);
    border-radius: var(--radius-sm);
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 700;
    font-family: var(--font-display);
    color: var(--green);
    letter-spacing: 0.5px;
    pointer-events: none;
    animation: slide-up 0.3s var(--ease), fade-scale-in 0.3s var(--ease);
    box-shadow: var(--shadow-green);
    white-space: nowrap;
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 1200px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
    :root { --sidebar-w: 0px; }
    .sidebar { transform: translateX(-260px); transition: transform var(--t); }
    .sidebar.open { transform: translateX(0); --sidebar-w: 260px; }
    .main-content { margin-left: 0; padding: 24px 20px; }
}

@media (max-width: 600px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .auth-card { padding: 28px 24px; }
    .marketplace-grid { grid-template-columns: 1fr; }
}
