:root {
    /* Luminous Design Tokens - Matching Reference */
    --glass: rgba(20, 30, 50, 0.35);
    --glass-bright: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(180, 200, 220, 0.25);
    --border: rgba(255, 255, 255, 0.12);

    --text: #e8eef4;
    --text-dim: #8aa4c0;

    --accent: #4da8da;
    --accent-gold: #d4a853;
    --accent-orange: #e8a445;

    --glow: rgba(77, 168, 218, 0.4);
    --glow-gold: rgba(212, 168, 83, 0.5);

    --kernel-stable: #5cb85c;
    --kernel-scan: #5bc0de;

    --bg: #0a1020;
    --card-shadow: 0 15px 50px -15px rgba(0, 0, 0, 0.6);

    --sidebar-width: 200px;
    --panel-radius: 20px;
}

* {
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

/* STARRY SPACE BACKGROUND */
body {
    background: var(--bg);
    background-image: url('shared/assets/starry_bg.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text);
    font-family: 'Inter', 'Segoe UI', sans-serif;
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    display: flex;
}

/* MAIN LAYOUT */
.main-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--glass);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--glass-border);
    border-radius: var(--panel-radius);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

/* SIDEBAR */
.luminous-sidebar {
    width: var(--sidebar-width);
    height: calc(100vh - 40px);
    background: transparent;
    display: flex;
    flex-direction: column;
    padding: 2rem 1rem;
    z-index: 1000;
    border-right: 1px solid var(--glass-border);
}

.sidebar-brand {
    padding: 0 0 2rem 0;
    display: flex;
    justify-content: center;
}

/* MARI ORB - Golden Concentric Rings */
.mari-orb {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mari-orb::before,
.mari-orb::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    border: 2px solid var(--accent-gold);
    box-shadow: 0 0 15px var(--glow-gold);
}

.mari-orb::before {
    width: 100%;
    height: 100%;
    animation: rotateOrb 15s linear infinite;
}

.mari-orb::after {
    width: 75%;
    height: 75%;
    border-style: dashed;
    animation: rotateOrb 10s linear infinite reverse;
}

.orb-inner {
    width: 50%;
    height: 50%;
    border: 2px solid var(--accent-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--accent-gold);
    text-shadow: 0 0 8px var(--glow-gold);
    z-index: 1;
}

@keyframes rotateOrb {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* SIDEBAR NAVIGATION */
.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.nav-section {
    margin-bottom: 1.5rem;
}

.section-label {
    display: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.7rem 1rem;
    text-decoration: none;
    color: var(--text-dim);
    font-size: 0.85rem;
    font-weight: 400;
    border-radius: 10px;
    transition: 0.3s;
    margin-bottom: 4px;
}

.nav-item .icon {
    font-size: 1rem;
    width: 20px;
    display: flex;
    justify-content: center;
    color: var(--accent-gold);
}

.nav-item:hover {
    color: #fff;
}

.nav-item.active {
    color: #fff;
}

/* TOP BAR */
.luminous-top-bar {
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
}

.top-tabs {
    display: flex;
    gap: 2rem;
}

.tab-item {
    text-decoration: none;
    color: var(--text-dim);
    font-size: 0.9rem;
    font-weight: 400;
    padding: 0.5rem 0;
    position: relative;
    transition: 0.3s;
}

.tab-item:hover,
.tab-item.active {
    color: #fff;
}

.tab-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent);
}

.top-widgets {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.clock-widget {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
}

#stellarClock {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
}

/* STATUS PULSE */
.pulse-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--kernel-stable);
    box-shadow: 0 0 8px var(--kernel-stable);
}

.pulse-text {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--kernel-stable);
}

/* SUB-TABS ROW */
.sub-tabs {
    display: flex;
    gap: 1rem;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--glass-border);
}

.sub-tab {
    padding: 0.5rem 1.2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-dim);
    font-size: 0.8rem;
    text-decoration: none;
    transition: 0.3s;
}

.sub-tab:hover,
.sub-tab.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* MAIN CONTENT AREA */
.main-container {
    padding: 2rem;
    flex: 1;
    overflow-y: auto;
}

.hero-card {
    background: transparent;
    padding: 0;
    margin-bottom: 0;
}

h1 {
    font-size: 1.8rem;
    margin: 0 0 0.5rem 0;
    font-weight: 500;
    color: #fff;
}

/* DASHBOARD CARDS */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.luminous-card {
    background: linear-gradient(180deg, rgba(30, 50, 80, 0.5) 0%, rgba(20, 40, 70, 0.6) 100%);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: 0.3s;
    min-height: 280px;
    display: flex;
    flex-direction: column;
}

.luminous-card::before {
    display: none;
}

.luminous-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.3);
}

.card-icon {
    width: 60px;
    height: 60px;
    margin: 1rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--accent);
    opacity: 0.8;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.3rem;
    color: #fff;
}

.card-subtitle {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: auto;
    flex: 1;
}

.card-status-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin: 1rem 0 0.5rem 0;
    position: relative;
}

.card-status-bar::before,
.card-status-bar::after {
    content: '';
    position: absolute;
    bottom: -15px;
    font-size: 0.6rem;
    color: var(--text-dim);
}

.status-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    position: relative;
}

.status-fill::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent);
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 0.5rem;
}

.price-tag {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}

.card-actions {
    display: flex;
    gap: 8px;
}

.card-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--accent-gold);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

/* SIDEBAR FOOTER */
.sidebar-footer {
    padding: 1rem 0;
    border-top: 1px solid var(--glass-border);
}

.lang-selector-v {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.lang-btn {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-dim);
    cursor: pointer;
    transition: 0.2s;
}

.lang-btn.active,
.lang-btn:hover {
    color: var(--accent-gold);
}

.legal-tag {
    font-size: 0.5rem;
    color: var(--text-dim);
    text-align: center;
    letter-spacing: 1px;
    opacity: 0.4;
}

/* BUTTONS */
.btn-stellar {
    background: rgba(77, 168, 218, 0.15);
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 6px 14px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 500;
    transition: 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-stellar:hover {
    background: var(--accent);
    color: #fff;
}

/* JSON VISOR */
.json-visor {
    background: rgba(0, 20, 40, 0.5);
    padding: 1rem;
    border-radius: 10px;
    border-left: 3px solid var(--accent);
    font-family: 'Fira Code', monospace;
    font-size: 0.7rem;
    color: var(--accent);
    line-height: 1.5;
    white-space: pre-wrap;
    margin-top: 2rem;
}

/* THAI SPECIFIC */
body[lang="th"] {
    font-family: 'Noto Sans Thai', sans-serif;
}

/* RESPONSIVE DESIGN */
@media (max-width: 1200px) {
    .dash-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    :root {
        --sidebar-width: 80px;
    }

    .nav-item span:not(.icon),
    .legal-tag {
        display: none;
    }

    .nav-item {
        justify-content: center;
        padding: 0.8rem;
    }

    .mari-orb {
        width: 60px;
        height: 60px;
    }

    .orb-inner {
        font-size: 0.4rem;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
        flex-direction: column;
    }

    .luminous-sidebar {
        width: 100%;
        height: auto;
        flex-direction: row;
        padding: 0.5rem 1rem;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        border-right: none;
        border-top: 1px solid var(--glass-border);
        background: rgba(10, 16, 32, 0.95);
        backdrop-filter: blur(20px);
        z-index: 1000;
    }

    .sidebar-brand,
    .sidebar-footer {
        display: none;
    }

    .sidebar-nav {
        display: flex;
        padding: 0;
        width: 100%;
        justify-content: space-around;
    }

    .nav-section {
        margin: 0;
        display: flex;
    }

    .nav-item {
        margin: 0;
        padding: 0.5rem;
    }

    .main-content-wrapper {
        margin-bottom: 70px;
        border-radius: 15px;
    }

    .luminous-top-bar {
        padding: 0.8rem 1rem;
        flex-direction: column;
        gap: 0.8rem;
    }

    .top-tabs {
        width: 100%;
        justify-content: center;
        gap: 1rem;
    }

    .clock-widget {
        display: none;
    }

    .main-container {
        padding: 1rem;
    }

    .dash-grid {
        grid-template-columns: 1fr;
    }

    .luminous-card {
        min-height: auto;
    }
}