/* ============================================
   TRACKOVO DEMO — PREMIUM UI v2
   ============================================ */

:root {
    --bg: #0a0a0f;
    --bg-card: #12121a;
    --bg-card-hover: #1a1a26;
    --bg-sidebar: #0e0e16;
    --bg-surface: #16161f;
    --bg-elevated: #1e1e2a;

    --text: #e8e8f0;
    --text-dim: #8888a0;
    --text-muted: #55556a;

    --accent: #6c5ce7;
    --accent-light: #a29bfe;
    --accent-glow: rgba(108, 92, 231, 0.3);
    --accent-surface: rgba(108, 92, 231, 0.08);

    --green: #00cec9;
    --green-glow: rgba(0, 206, 201, 0.2);
    --orange: #fdcb6e;
    --red: #ff7675;
    --blue: #74b9ff;
    --pink: #fd79a8;
    --teal: #55efc4;

    --border: rgba(255, 255, 255, 0.06);
    --border-active: rgba(108, 92, 231, 0.4);

    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 40px var(--accent-glow);

    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);

    --sidebar-width: 280px;
    --topbar-height: 56px;
}

/* ============ RESET ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg); color: var(--text);
    overflow: hidden; height: 100vh;
}
.hidden { display: none !important; }
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
img { max-width: 100%; display: block; }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ============ LOADER ============ */
.loader {
    position: fixed; inset: 0; z-index: 9999;
    background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}
.loader.fade-out { opacity: 0; visibility: hidden; }
.loader-content { text-align: center; }
.loader-logo {
    width: 72px; height: 72px; margin: 0 auto 24px;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    animation: loaderPulse 1.5s ease-in-out infinite;
    box-shadow: var(--shadow-glow);
}
.loader-icon { font-size: 32px; font-weight: 900; color: white; }
.loader-bar { width: 200px; height: 3px; background: var(--bg-elevated); border-radius: 10px; overflow: hidden; margin: 0 auto; }
.loader-bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-light)); border-radius: 10px; animation: loaderFill 1.8s ease forwards; }
.loader-text { margin-top: 16px; color: var(--text-dim); font-size: 0.85rem; letter-spacing: 0.5px; }
@keyframes loaderPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes loaderFill { 0% { width: 0; } 50% { width: 60%; } 100% { width: 100%; } }

/* ============ TOP BAR ============ */
.topbar {
    height: var(--topbar-height);
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 16px; position: relative; z-index: 100;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-center { flex: 1; display: flex; justify-content: center; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.hamburger {
    width: 36px; height: 36px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
    border-radius: var(--radius-sm); transition: var(--transition);
}
.hamburger:hover { background: var(--bg-elevated); }
.hamburger span { display: block; width: 18px; height: 2px; background: var(--text-dim); border-radius: 2px; transition: var(--transition); }
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.logo { display: flex; align-items: center; gap: 10px; }
.logo-mark {
    width: 30px; height: 30px;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    border-radius: 8px; display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: 15px; color: white;
}
.logo-text { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.5px; }
.logo-badge {
    padding: 2px 8px; border-radius: 20px;
    background: var(--accent-surface); color: var(--accent-light);
    font-size: 0.6rem; font-weight: 700; letter-spacing: 1px;
}

.breadcrumb { display: flex; align-items: center; gap: 8px; }
.bc-module { color: var(--text-dim); font-size: 0.85rem; font-weight: 500; }
.bc-sep { color: var(--text-muted); font-size: 0.75rem; }
.bc-item { color: var(--accent-light); font-size: 0.85rem; font-weight: 500; }

.btn-topbar {
    display: flex; align-items: center; gap: 5px;
    padding: 6px 12px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); font-size: 0.75rem; font-weight: 500;
    color: var(--text-dim); transition: var(--transition);
}
.btn-topbar:hover { border-color: var(--accent); color: var(--accent-light); }
.btn-topbar.active { background: var(--accent-surface); border-color: var(--accent); color: var(--accent-light); }

.auto-play-toggle { display: flex; align-items: center; gap: 6px; }
.toggle-label { font-size: 0.75rem; color: var(--text-dim); }
.toggle-switch { position: relative; display: inline-block; width: 36px; height: 20px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; inset: 0; cursor: pointer;
    background: var(--bg-elevated); border-radius: 20px; border: 1px solid var(--border); transition: var(--transition);
}
.toggle-slider::before {
    content: ''; position: absolute; width: 14px; height: 14px; left: 2px; bottom: 2px;
    background: var(--text-dim); border-radius: 50%; transition: var(--transition);
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent); border-color: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(16px); background: white; }

/* ============ LAYOUT ============ */
.main-layout { display: flex; height: calc(100vh - var(--topbar-height)); }

/* ============ SIDEBAR ============ */
.sidebar {
    width: var(--sidebar-width); min-width: var(--sidebar-width);
    background: var(--bg-sidebar); border-right: 1px solid var(--border);
    display: flex; flex-direction: column; transition: var(--transition); overflow: hidden;
}
.sidebar.collapsed { width: 0; min-width: 0; border-right: none; }
.sidebar-header {
    padding: 16px 16px 10px;
    display: flex; align-items: center; justify-content: space-between;
}
.sidebar-header h3 {
    font-size: 0.7rem; font-weight: 600; letter-spacing: 1.5px;
    text-transform: uppercase; color: var(--text-muted);
}
.module-count {
    font-size: 0.65rem; color: var(--text-muted);
    padding: 2px 8px; background: var(--bg-elevated); border-radius: 20px;
}
.sidebar-nav { flex: 1; overflow-y: auto; padding: 0 8px 20px; }

.module-item { margin-bottom: 2px; border-radius: var(--radius); overflow: hidden; }
.module-btn {
    width: 100%; display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: var(--radius);
    transition: var(--transition); position: relative; text-align: left;
}
.module-btn:hover { background: var(--bg-card-hover); }
.module-btn.active { background: var(--accent-surface); }
.module-btn.active::before {
    content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 60%; background: var(--accent); border-radius: 0 3px 3px 0;
}
.module-icon {
    width: 34px; height: 34px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; flex-shrink: 0; transition: var(--transition);
}
.module-btn.active .module-icon { transform: scale(1.1); }
.module-name { font-size: 0.85rem; font-weight: 500; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.module-btn.active .module-name { color: var(--accent-light); font-weight: 600; }
.module-arrow { color: var(--text-muted); transition: var(--transition); flex-shrink: 0; }
.module-btn.active .module-arrow { transform: rotate(90deg); color: var(--accent-light); }
.module-sub-count {
    font-size: 0.65rem; color: var(--text-muted);
    background: var(--bg-elevated); padding: 1px 6px; border-radius: 10px; flex-shrink: 0;
}

/* Dimmed state for role filtering */
.module-btn.dimmed { opacity: 0.3; }
.module-btn.dimmed:hover { opacity: 0.5; }

/* ============ CONTENT ============ */
.content { flex: 1; overflow-y: auto; overflow-x: hidden; position: relative; }

/* ============ OVERVIEW PAGE ============ */
.overview-page { padding: 0; }

/* ---- HERO ---- */
.hero {
    position: relative; padding: 60px 40px 40px;
    text-align: center; overflow: hidden;
}
.hero-bg-grid {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(108, 92, 231, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(108, 92, 231, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}
.hero-glow {
    position: absolute; top: -100px; left: 50%; transform: translateX(-50%);
    width: 600px; height: 400px;
    background: radial-gradient(ellipse, rgba(108, 92, 231, 0.15), transparent 70%);
    pointer-events: none;
}
.hero-content { position: relative; z-index: 1; max-width: 700px; margin: 0 auto; }
.hero-badge {
    display: inline-block; padding: 6px 16px; border-radius: 100px;
    background: var(--accent-surface); border: 1px solid var(--border-active);
    font-size: 0.75rem; font-weight: 600; color: var(--accent-light);
    letter-spacing: 0.5px; margin-bottom: 20px;
    animation: fadeInUp 0.6s ease both;
}
.hero-title {
    font-size: 2.8rem; font-weight: 800; line-height: 1.15;
    letter-spacing: -1.5px; color: var(--text);
    animation: fadeInUp 0.6s ease 0.1s both;
}
.hero-gradient {
    background: linear-gradient(135deg, var(--accent-light), var(--green), var(--blue));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-sub {
    margin-top: 16px; font-size: 1.05rem; line-height: 1.7;
    color: var(--text-dim); max-width: 560px; margin-left: auto; margin-right: auto;
    animation: fadeInUp 0.6s ease 0.2s both;
}

/* ---- STATS STRIP ---- */
.stats-strip {
    display: flex; align-items: center; justify-content: center;
    gap: 0; margin-top: 40px; position: relative; z-index: 1;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-xl); padding: 20px 32px;
    max-width: 600px; margin-left: auto; margin-right: auto;
    animation: fadeInUp 0.6s ease 0.3s both;
}
.stat-block { text-align: center; flex: 1; }
.stat-number {
    display: block; font-size: 2rem; font-weight: 800;
    background: linear-gradient(135deg, var(--text), var(--accent-light));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.stat-label { font-size: 0.75rem; color: var(--text-dim); font-weight: 500; margin-top: 2px; }
.stat-divider { width: 1px; height: 40px; background: var(--border); margin: 0 8px; flex-shrink: 0; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---- SECTION HEADINGS ---- */
.section-heading {
    font-size: 1.4rem; font-weight: 700; text-align: center;
    letter-spacing: -0.5px; margin-bottom: 6px;
}
.section-sub {
    text-align: center; color: var(--text-dim); font-size: 0.9rem;
    margin-bottom: 24px;
}

/* ---- LIFECYCLE FLOW ---- */
.lifecycle-section { padding: 48px 24px 32px; }
.lifecycle-track {
    overflow-x: auto; padding: 8px 0 16px;
    -webkit-overflow-scrolling: touch;
}
.lifecycle-scroll {
    display: flex; align-items: center; justify-content: center;
    gap: 0; min-width: max-content; padding: 0 20px;
}
.lc-step {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 20px 18px;
    text-align: center; min-width: 130px; max-width: 150px;
    transition: var(--transition); cursor: default;
    animation: fadeInUp 0.5s ease both;
}
.lc-step:nth-child(1) { animation-delay: 0.1s; }
.lc-step:nth-child(3) { animation-delay: 0.15s; }
.lc-step:nth-child(5) { animation-delay: 0.2s; }
.lc-step:nth-child(7) { animation-delay: 0.25s; }
.lc-step:nth-child(9) { animation-delay: 0.3s; }
.lc-step:nth-child(11) { animation-delay: 0.35s; }
.lc-step:nth-child(13) { animation-delay: 0.4s; }
.lc-step:hover {
    border-color: var(--accent); transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(108, 92, 231, 0.15);
}
.lc-icon { font-size: 28px; margin-bottom: 8px; }
.lc-label { font-size: 0.82rem; font-weight: 600; margin-bottom: 4px; }
.lc-sub { font-size: 0.7rem; color: var(--text-dim); line-height: 1.4; }
.lc-arrow {
    color: var(--accent); flex-shrink: 0; padding: 0 4px;
    animation: arrowPulse 2s ease-in-out infinite;
}
@keyframes arrowPulse {
    0%, 100% { opacity: 0.4; transform: translateX(0); }
    50% { opacity: 1; transform: translateX(3px); }
}

/* ---- ROLES SECTION ---- */
.roles-section { padding: 32px 24px 40px; }
.role-buttons {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
    margin-bottom: 24px;
}
.role-btn {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 18px; border-radius: 100px;
    background: var(--bg-card); border: 1px solid var(--border);
    font-size: 0.82rem; font-weight: 500; color: var(--text-dim);
    transition: var(--transition);
}
.role-btn:hover { border-color: var(--accent); color: var(--text); transform: translateY(-2px); }
.role-btn.active {
    background: var(--accent-surface); border-color: var(--accent);
    color: var(--accent-light); box-shadow: 0 4px 20px var(--accent-glow);
}
.role-icon { font-size: 1.1rem; }
.role-name { font-weight: 500; }

.role-detail {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-xl); padding: 28px;
    max-width: 900px; margin: 0 auto;
    animation: fadeInUp 0.3s ease;
}
.role-detail-title {
    font-size: 1.1rem; font-weight: 700; margin-bottom: 16px;
    display: flex; align-items: center; gap: 10px;
}
.role-modules-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px;
}
.role-module-card {
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 14px;
    transition: var(--transition); cursor: pointer;
}
.role-module-card:hover {
    border-color: var(--accent); transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
}
.role-module-card.highlight {
    border-color: var(--accent); background: var(--accent-surface);
}
.rmc-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.rmc-icon { font-size: 1.3rem; }
.rmc-name { font-size: 0.9rem; font-weight: 600; }
.rmc-access {
    margin-left: auto; font-size: 0.65rem; padding: 2px 8px;
    border-radius: 20px; font-weight: 600;
}
.rmc-access.full { background: rgba(0, 206, 201, 0.15); color: var(--green); }
.rmc-access.partial { background: rgba(253, 203, 110, 0.15); color: var(--orange); }
.rmc-access.view { background: rgba(116, 185, 255, 0.15); color: var(--blue); }
.rmc-access.none { background: rgba(255, 118, 117, 0.1); color: var(--red); opacity: 0.5; }
.rmc-features {
    display: flex; flex-wrap: wrap; gap: 4px;
}
.rmc-feat {
    font-size: 0.68rem; padding: 2px 8px; border-radius: 20px;
    background: var(--bg-elevated); color: var(--text-dim);
}

/* ---- SECTION DIVIDER ---- */
.section-divider {
    width: 60px; height: 3px; margin: 0 auto;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    border-radius: 10px; opacity: 0.4;
}

/* ---- INTERCONNECTION GRID ---- */
.interconnect-section {
    padding: 40px 24px 48px;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.connect-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 12px; max-width: 1000px; margin: 0 auto;
}
.connect-card {
    display: flex; align-items: center; gap: 14px;
    padding: 16px 18px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: var(--transition);
    cursor: pointer;
}
.connect-card:hover {
    border-color: var(--border-active);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
}
.cc-from, .cc-to {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    min-width: 60px;
}
.cc-icon { font-size: 1.4rem; }
.cc-name { font-size: 0.7rem; font-weight: 600; color: var(--text-dim); white-space: nowrap; }
.cc-arrow {
    color: var(--accent); font-size: 1.2rem;
    display: flex; align-items: center;
    animation: arrowFlow 2s ease-in-out infinite;
    flex-shrink: 0;
}
@keyframes arrowFlow {
    0%, 100% { opacity: 0.5; transform: translateX(0); }
    50% { opacity: 1; transform: translateX(4px); }
}
.cc-desc {
    flex: 1; font-size: 0.78rem; color: var(--text-dim); line-height: 1.4;
}

/* ---- MODULE GRID CARDS ---- */
.modules-grid-section { padding: 32px 24px 60px; }
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px; max-width: 1100px; margin: 0 auto;
}
.mod-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-xl); padding: 24px;
    cursor: pointer; transition: var(--transition);
    position: relative; overflow: hidden;
}
.mod-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    opacity: 0; transition: var(--transition);
}
.mod-card:hover {
    border-color: var(--border-active);
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}
.mod-card:hover::before { opacity: 1; }
.mc-header { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.mc-icon {
    width: 48px; height: 48px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
}
.mc-name { font-size: 1.05rem; font-weight: 700; }
.mc-desc { font-size: 0.8rem; color: var(--text-dim); line-height: 1.5; margin-bottom: 16px; }
.mc-stats-row { display: flex; gap: 12px; }
.mc-stat {
    display: flex; align-items: center; gap: 4px;
    font-size: 0.72rem; color: var(--text-muted);
}
.mc-stat-num { font-weight: 700; color: var(--text-dim); }
.mc-explore {
    position: absolute; bottom: 20px; right: 20px;
    font-size: 0.72rem; font-weight: 600; color: var(--accent-light);
    display: flex; align-items: center; gap: 4px;
    opacity: 0; transform: translateX(-8px);
    transition: var(--transition);
}
.mod-card:hover .mc-explore { opacity: 1; transform: translateX(0); }

/* ============ MODULE VIEW ============ */
.module-view { padding: 20px; height: 100%; display: flex; flex-direction: column; }
.module-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); margin-bottom: 16px;
    animation: fadeInUp 0.4s ease;
}
.module-header-left { display: flex; align-items: center; gap: 12px; }
.back-btn {
    width: 36px; height: 36px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); color: var(--text-dim);
    transition: var(--transition);
}
.back-btn:hover { border-color: var(--accent); color: var(--accent-light); }
.module-icon-wrap {
    width: 48px; height: 48px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center; font-size: 24px;
}
.module-title { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.5px; }
.module-desc { color: var(--text-dim); font-size: 0.8rem; margin-top: 2px; }
.module-stats { display: flex; gap: 10px; }
.stat-pill {
    padding: 5px 12px; border-radius: 100px;
    background: var(--bg-surface); border: 1px solid var(--border);
    font-size: 0.75rem; color: var(--text-dim);
    display: flex; align-items: center; gap: 5px;
}
.stat-num { font-weight: 700; color: var(--text); }

/* MODULE BODY SPLIT */
.module-body {
    flex: 1; display: flex; gap: 16px; min-height: 0;
    animation: fadeInUp 0.5s ease 0.1s both;
}
.module-list-panel {
    width: 400px; min-width: 340px; overflow-y: auto;
    display: flex; flex-direction: column; gap: 12px; padding-right: 4px;
}
.preview-panel {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    gap: 14px; position: sticky; top: 0;
}

/* SECTION BLOCKS */
.section-block {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 14px;
}
.section-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.7rem; font-weight: 600; letter-spacing: 1px;
    text-transform: uppercase; color: var(--text-muted);
    margin-bottom: 10px; padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.section-title svg { color: var(--accent); }

/* ITEM CARDS */
.item-card {
    padding: 10px 12px; border-radius: var(--radius);
    border: 1px solid transparent; cursor: pointer;
    transition: var(--transition); position: relative; margin-bottom: 3px;
}
.item-card:hover { background: var(--bg-card-hover); border-color: var(--border); }
.item-card.active { background: var(--accent-surface); border-color: var(--border-active); }
.item-card.active::after {
    content: ''; position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--accent); box-shadow: 0 0 10px var(--accent-glow);
    animation: activePulse 2s ease infinite;
}
@keyframes activePulse { 0%, 100% { box-shadow: 0 0 6px var(--accent-glow); } 50% { box-shadow: 0 0 16px var(--accent-glow); } }

.item-card-header { display: flex; align-items: center; gap: 8px; }
.item-index {
    width: 22px; height: 22px; border-radius: 6px;
    background: var(--bg-surface); color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.65rem; font-weight: 700; flex-shrink: 0;
}
.item-card.active .item-index { background: var(--accent); color: white; }
.item-name { font-size: 0.82rem; font-weight: 500; flex: 1; }
.item-card.active .item-name { color: var(--accent-light); }
.item-badge {
    font-size: 0.6rem; padding: 2px 7px; border-radius: 20px; font-weight: 600; letter-spacing: 0.5px;
}
.item-badge.workflow { background: rgba(0, 206, 201, 0.1); color: var(--green); }
.item-badge.feature { background: rgba(253, 203, 110, 0.1); color: var(--orange); }
.item-card-preview {
    margin-top: 4px; padding-left: 30px;
    font-size: 0.75rem; color: var(--text-dim); line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.item-images-badge {
    display: flex; align-items: center; gap: 3px;
    font-size: 0.65rem; color: var(--text-muted); margin-left: auto; flex-shrink: 0;
}
.item-images-badge svg { width: 11px; height: 11px; }
.item-images-badge.has-images { color: var(--green); }

/* ============ PHONE MOCKUP ============ */
.phone-frame {
    width: 260px; height: 520px;
    background: #1a1a2e; border-radius: 32px;
    border: 3px solid #2a2a3e; padding: 10px;
    position: relative;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.05), 0 20px 60px rgba(0,0,0,0.5), 0 0 80px rgba(108,92,231,0.1);
    transition: var(--transition);
}
.phone-frame:hover {
    box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 24px 70px rgba(0,0,0,0.6), 0 0 100px rgba(108,92,231,0.15);
    transform: translateY(-4px);
}
.phone-notch {
    position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
    width: 70px; height: 5px; background: #2a2a3e; border-radius: 10px; z-index: 5;
}
.phone-screen {
    width: 100%; height: 100%; background: #0d0d1a;
    border-radius: 22px; overflow: hidden;
    display: flex; align-items: center; justify-content: center; position: relative;
}
.phone-placeholder { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--text-muted); }
.phone-placeholder p { font-size: 0.75rem; text-align: center; padding: 0 16px; }
.phone-image { width: 100%; height: 100%; object-fit: cover; animation: imageIn 0.4s ease; }
@keyframes imageIn { from { opacity: 0; transform: scale(1.05); } to { opacity: 1; transform: scale(1); } }
.phone-home-bar {
    position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%);
    width: 90px; height: 4px; background: #3a3a4e; border-radius: 10px;
}

/* UPLOAD ZONE */
.upload-zone {
    position: absolute; inset: 0; z-index: 10;
    display: flex; align-items: center; justify-content: center;
    background: rgba(10, 10, 15, 0.9); backdrop-filter: blur(8px);
}
.upload-zone-inner {
    text-align: center; padding: 16px;
    border: 2px dashed var(--accent); border-radius: var(--radius-lg);
    margin: 12px; width: calc(100% - 24px); height: calc(100% - 24px);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 6px; transition: var(--transition); cursor: pointer;
}
.upload-zone-inner.dragover { background: var(--accent-surface); border-color: var(--accent-light); transform: scale(1.02); }
.upload-zone-inner svg { color: var(--accent-light); }
.upload-title { font-size: 0.85rem; font-weight: 600; }
.upload-sub { font-size: 0.7rem; color: var(--text-dim); }
.upload-zone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* PREVIEW INFO */
.preview-info {
    width: 100%; max-width: 300px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 16px; text-align: center;
}
.preview-info-placeholder p { color: var(--text-muted); font-size: 0.8rem; }
.preview-info-content { animation: fadeInUp 0.3s ease; }
.preview-info-content h4 { font-size: 0.95rem; font-weight: 600; margin-bottom: 6px; color: var(--accent-light); }
.preview-info-content p { font-size: 0.8rem; color: var(--text-dim); line-height: 1.6; }
.workflow-steps { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 5px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.wf-step { padding: 3px 9px; border-radius: 20px; background: var(--bg-surface); font-size: 0.68rem; font-weight: 500; color: var(--text-dim); white-space: nowrap; }
.wf-arrow { color: var(--accent); font-size: 0.7rem; }

/* CAROUSEL */
.carousel-controls { display: flex; align-items: center; gap: 10px; }
.carousel-btn {
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--bg-card); border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-dim); transition: var(--transition);
}
.carousel-btn:hover { border-color: var(--accent); color: var(--accent-light); }
.carousel-dots { display: flex; gap: 5px; }
.carousel-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); cursor: pointer; transition: var(--transition); }
.carousel-dot.active { background: var(--accent); width: 20px; border-radius: 10px; }

/* ============ TOAST ============ */
.toast {
    position: fixed; bottom: 24px; right: 24px;
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 12px 20px;
    display: flex; align-items: center; gap: 10px;
    box-shadow: var(--shadow-lg); z-index: 10000;
    animation: toastIn 0.3s ease;
}
.toast.hidden { display: none; }
.toast-msg { font-size: 0.85rem; color: var(--text); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* ============ MODULE COLORS ============ */
.color-material { background: rgba(108, 92, 231, 0.12); }
.color-accounts { background: rgba(0, 206, 201, 0.12); }
.color-planning { background: rgba(116, 185, 255, 0.12); }
.color-attendance { background: rgba(253, 203, 110, 0.12); }
.color-machines { background: rgba(255, 118, 117, 0.12); }
.color-measurement { background: rgba(162, 155, 254, 0.12); }
.color-labour { background: rgba(253, 121, 168, 0.12); }
.color-vendor { background: rgba(85, 239, 196, 0.12); }

/* ============ RESPONSIVE ============ */
@media (max-width: 1100px) {
    .module-body { flex-direction: column; }
    .module-list-panel { width: 100%; min-width: 0; }
    .preview-panel { position: static; }
    .phone-frame { width: 220px; height: 440px; }
    .hero-title { font-size: 2rem; }
    .interconnect-map { height: 300px; }
}
@media (max-width: 768px) {
    .sidebar { position: fixed; left: 0; top: var(--topbar-height); bottom: 0; z-index: 90; }
    .sidebar.collapsed { transform: translateX(-100%); }
    .topbar-center { display: none; }
    .module-header { flex-direction: column; gap: 10px; }
    .module-stats { width: 100%; justify-content: center; flex-wrap: wrap; }
    .hero-title { font-size: 1.6rem; }
    .stats-strip { flex-wrap: wrap; gap: 8px; padding: 16px; }
    .stat-divider { display: none; }
    .role-modules-grid { grid-template-columns: 1fr; }
    .modules-grid { grid-template-columns: 1fr; }
    .lifecycle-scroll { justify-content: flex-start; }
    .interconnect-map { height: 250px; }
    .connect-node { padding: 8px 10px; min-width: 70px; }
    .cn-icon { font-size: 1.1rem; }
    .cn-name { font-size: 0.65rem; }
}
