:root {
    --primary-color: #00f3ff;
    --primary-hover: #00c3cc;
    --secondary-color: #bd00ff;
    --accent-color: #ff007a;
    --success-color: #00e676;
    
    --bg-dark: #13131f; /* Deeper neon bg */
    --panel-bg: #1f1f31; /* Solid dark panels */
    --glass-border: rgba(255, 255, 255, 0.04);
    --neon-glow: rgba(0, 243, 255, 0.4);
    
    --text-primary: #ffffff;
    --text-secondary: #8c8cab;
    
    --sidebar-width: 260px;
    --transition-speed: 0.3s;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    position: relative;
    font-size: 14px;
}

/* --- Ambient Background Lights (Crypto Style) --- */
.ambient-light {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.4;
    animation: float 25s infinite ease-in-out alternate;
}
.light-1 {
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(189,0,255,0.25) 0%, transparent 60%);
    top: -200px;
    left: -150px;
}
.light-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0,243,255,0.2) 0%, transparent 60%);
    bottom: -150px;
    right: -100px;
    animation-delay: -5s;
}
.light-3 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(255,0,122,0.15) 0%, transparent 60%);
    top: 40%;
    left: 30%;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(80px, 40px) scale(1.1); }
    100% { transform: translate(-40px, -60px) scale(0.9); }
}

/* --- Core Layout --- */
#app {
    display: flex;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    z-index: 10;
    background-color: #171725;
    border-right: 1px solid var(--glass-border);
    box-shadow: 5px 0 20px rgba(0,0,0,0.3);
}

.glass-panel {
    background: var(--panel-bg);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255,255,255,0.03);
    position: relative;
    z-index: 1;
}

/* Sidebar does not need corner radius */
aside.glass-panel { border-radius: 0; box-shadow: none; border:none; border-right: 1px solid var(--glass-border); }

.logo-area {
    padding: 2.5rem 1.5rem;
    text-align: center;
}

.logo-title {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 0.2rem;
    color: #fff;
    text-shadow: 0 0 10px rgba(255,255,255,0.3);
}

.logo-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.text-gradient {
    background: linear-gradient(135deg, #00f3ff, #bd00ff, #ff007a);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% auto;
    animation: shine 4s linear infinite;
    font-weight: 800;
}

@keyframes shine { to { background-position: 200% center; } }

.nav-menu {
    display: flex;
    flex-direction: column;
    padding: 0 1rem;
    flex: 1;
    gap: 0.5rem;
}

.nav-btn {
    position: relative;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 1rem 1.25rem;
    text-align: left;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    overflow: hidden;
}

.nav-btn .btn-text { position: relative; z-index: 2; }

/* The left side neon indicator */
.nav-indicator {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) scaleY(0);
    width: 4px;
    height: 60%;
    background: var(--primary-color);
    border-radius: 0 4px 4px 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 15px var(--primary-color);
}

.nav-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.02);
}

.nav-btn.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(0, 243, 255, 0.1), transparent);
}

.nav-btn.active .nav-indicator {
    transform: translateY(-50%) scaleY(1);
}

.mt-auto { margin-top: auto; margin-bottom: 1.5rem; }

/* --- System Monitor Diagnostic Widget --- */
.sys-monitor {
    margin-top: auto;
    padding: 1rem 1.2rem;
    background: rgba(0, 0, 0, 0.25);
    border-top: 1px solid var(--glass-border);
    font-family: 'Inter', sans-serif;
}

.monitor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.mon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2px;
}

.mon-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    font-weight: 700;
    text-transform: uppercase;
}

.mon-value {
    font-size: 0.8rem;
    color: #fff;
    font-weight: 600;
}

.mon-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.25);
    margin-top: 1rem;
    font-family: 'Inter', monospace;
}

/* --- Optimized Sidebar Actions --- */
.btn-tactical {
    width: 100%;
    position: relative;
    background: linear-gradient(135deg, rgba(0, 243, 255, 0.05), rgba(189, 0, 255, 0.05));
    border: 1px solid rgba(0, 243, 255, 0.2);
    color: var(--primary-color);
    padding: 0.8rem;
    border-radius: var(--radius-sm);
    font-weight: 800;
    font-size: 0.9rem;
    letter-spacing: 1px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-tactical:hover {
    background: linear-gradient(135deg, rgba(0, 243, 255, 0.2), rgba(189, 0, 255, 0.2));
    border-color: var(--primary-color);
    box-shadow: 0 0 25px rgba(0, 243, 255, 0.3);
    transform: translateY(-2px);
    color: #fff;
}

.btn-tactical .btn-glare {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: 0.5s;
}

.btn-tactical:hover .btn-glare {
    left: 100%;
}


.mon-status { display: flex; align-items: center; justify-content: center; color: var(--success-color); }
.status-offline { color: var(--accent-color) !important; }


/* --- Main Content Area --- */
.content {
    flex: 1;
    /* 右侧 padding 减去自定义滚动条的 8px，抵消视差，实现全屏完美居中 */
    padding: 2.5rem calc(3rem - 8px) 2.5rem 3rem;
    overflow-y: scroll;
    overflow-x: hidden;
    scroll-behavior: smooth;
    scroll-snap-type: y proximity;
    scroll-padding-top: 2.5rem;
}

/* Views & Animation */
.view { display: none; opacity: 0; }
.view.active { 
    display: flex; 
    flex-direction: column; 
    opacity: 1; 
    min-height: calc(100vh - 5rem); 
}

.fade-in { animation: fadeIn 0.4s ease-out forwards; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Typography & Headers --- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 1.5rem;
}

h1 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 0.4rem;
    color: #fff;
    text-shadow: 0 0 20px rgba(255,255,255,0.1);
}

.subtitle { color: var(--text-secondary); font-size: 0.95rem; }

h3.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #fff;
    display: flex;
    align-items: center;
}

h3.card-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background: var(--primary-color);
    border-radius: 2px;
    margin-right: 12px;
    box-shadow: 0 0 10px var(--primary-color);
}

.number-font { font-family: 'Inter', monospace; letter-spacing: -0.5px; }

.fw-bold { font-weight: 700; }
.fw-500 { font-weight: 500; }
.text-cyan { color: var(--primary-color); text-shadow: 0 0 10px rgba(0,243,255,0.4); }
.text-purple { color: var(--secondary-color); text-shadow: 0 0 10px rgba(189,0,255,0.4); }
.text-pink { color: var(--accent-color); text-shadow: 0 0 10px rgba(255,0,122,0.4); }
.text-green { color: var(--success-color); text-shadow: 0 0 10px rgba(0,230,118,0.4); }
.text-secondary { color: var(--text-secondary); }

/* --- Cards & Stats --- */
.card { padding: 1.5rem 2rem; }

.hover-lift { transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease; }
.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(0, 243, 255, 0.2);
    border-color: rgba(0, 243, 255, 0.3);
}

.flex-1 { flex: 1; min-width: 0; }
.flex-2 { flex: 2; min-width: 0; }
.mt-6 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0 !important; }

.chart-row { display: flex; gap: 1.5rem; }
.stats-grid { display: flex; gap: 1.5rem; margin-bottom: 1.5rem; }

.stat-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Add a glowing orb inside the stat card */
.stat-card::before {
    content: '';
    position: absolute;
    width: 150px;
    height: 150px;
    filter: blur(50px);
    opacity: 0.15;
    right: -50px;
    bottom: -50px;
    border-radius: 50%;
    z-index: 0;
}

.stat-card.glow-blue::before { background: #3b82f6; }
.stat-card.glow-cyan::before { background: var(--primary-color); }
.stat-card.glow-purple::before { background: var(--secondary-color); }
.stat-card.glow-pink::before { background: var(--accent-color); }

.stat-card > * { position: relative; z-index: 2; }

.stat-card .label {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.stat-card .value {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
    color: #fff;
    text-shadow: 0 0 20px rgba(255,255,255,0.2);
}

.glow-border { border-color: rgba(0, 243, 255, 0.5) !important; box-shadow: 0 0 15px rgba(0, 243, 255, 0.2); }

/* --- Checklists / Filters --- */
.filter-panel {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 100;
}

.advanced-filter-bar { display: flex; flex-wrap: wrap; gap: 1.5rem; }

.filter-group { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 0.6rem; }

.filter-group label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.checklist-dropdown { position: relative; width: 100%; }

.checklist-header {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    color: #fff;
    padding: 0.9rem 1.2rem;
    border-radius: 0.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.checklist-header:hover { border-color: rgba(255,255,255,0.15); }

.checklist-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #1a1a28;
    border: 1px solid rgba(0, 243, 255, 0.2);
    border-radius: 0.5rem;
    padding: 0.8rem;
    margin-top: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}

.checklist-content.active { display: block; animation: slideDown 0.2s ease-out; }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem;
    cursor: pointer;
    border-radius: 0.4rem;
    transition: background 0.2s;
}
.checklist-item:hover { background: rgba(0, 243, 255, 0.05); }

.custom-chk {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--text-secondary);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.custom-chk:checked {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
}

.custom-chk:checked::after {
    content: '✓';
    position: absolute;
    color: #000;
    font-weight: 800;
    font-size: 13px;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
}

.checklist-item label { cursor: pointer; flex: 1; user-select: none; font-size: 0.9rem; color: #e2e8f0; }

.selected-count {
    background: var(--primary-color);
    color: #000;
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-weight: 800;
    box-shadow: 0 0 10px var(--primary-color);
}

/* Forms & Controls */
.controls { display: flex; gap: 1rem; align-items: center; }

.glass-pill {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    padding: 0.4rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.transparent-select {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    padding-right: 1.5rem;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right center;
    background-size: 16px;
}
.transparent-select option { background: var(--bg-dark); color: #fff; }
.transparent-select:focus { color: var(--primary-color); }

.glass-input {
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.08);
    color: #fff;
    padding: 0.7rem 1rem;
    border-radius: 0.5rem;
    font-family: 'Inter', monospace;
    font-size: 1rem;
    transition: all 0.2s;
    outline: none;
    width: 100%;
}
.glass-input:focus { 
    border-color: var(--primary-color); 
    box-shadow: 0 0 12px rgba(0, 243, 255, 0.2); 
    background: rgba(0, 243, 255, 0.05);
}

/* --- Buttons --- */
.search-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.8rem 1.8rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary { 
    background: var(--primary-color); 
    color: #000; 
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.4);
}
.btn-primary:hover { 
    background: #00c3cc; 
    box-shadow: 0 0 25px rgba(0, 243, 255, 0.6);
    transform: translateY(-2px); 
}

.btn-purple { 
    background: var(--secondary-color); 
    color: #fff; 
    box-shadow: 0 0 15px rgba(189, 0, 255, 0.4);
}
.btn-purple:hover { 
    background: #a200ff; 
    box-shadow: 0 0 25px rgba(189, 0, 255, 0.6);
    transform: translateY(-2px); 
}

.btn-outline {
    background: transparent;
    color: #fff;
    border: 1px solid var(--glass-border);
}
.btn-outline:hover { background: rgba(255,255,255,0.08); box-shadow: 0 0 15px rgba(255,255,255,0.1); }

/* --- Tables --- */
.table-container {
    width: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.03);
}

.glass-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: rgba(0, 0, 0, 0.15);
}

.glass-table th {
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.8rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.glass-table td {
    padding: 0.6rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
}

/* --- Dashboard Specific Compact Table --- */
#view-dashboard .table-container {
    display: flex;
    flex-direction: column;
}
#view-dashboard .glass-table {
    flex: 1;
    height: 100%;
}
#view-dashboard .glass-table thead tr {
    height: 1px; /* 锁死表头高度，防止随表格拉伸而变形发胖 */
}
#view-dashboard .glass-table th {
    padding: 0.5rem 1.5rem;
}
#view-dashboard .glass-table td {
    padding: 0.35rem 1.5rem; /* 基础极简边距，靠 table 原生的 height 等分机制拉伸填充 */
    font-size: 0.85rem;
}

.glass-table tbody tr { transition: background 0.2s ease; }
.glass-table tbody tr:hover { background: rgba(0, 243, 255, 0.04); }

/* --- Compact Mode for Management View (Fit in 1 Screen) --- */
.header-actions { display: flex; align-items: center; gap: 1rem; }
.entry-grid-wrapper { display: flex; gap: 1.5rem; align-items: stretch; flex: 1; }
.entry-left { flex: 1; min-width: 0; display: flex; flex-direction: column; } /* Equal width 1:1 */
.entry-right { flex: 1; min-width: 0; display: flex; flex-direction: column; } /* Equal width 1:1 */

.year-control-group { 
    display: flex; 
    align-items: center; 
    gap: 0.4rem; 
    padding-right: 0.5rem; 
    border-right: 1px solid rgba(255,255,255,0.1); 
    margin-right: 0.5rem; 
}

.icon-btn-small {
    background: rgba(0, 243, 255, 0.15);
    border: 1px solid rgba(0, 243, 255, 0.3);
    color: var(--primary-color);
    width: 22px;
    height: 22px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1;
    transition: all 0.2s;
}
.icon-btn-small:hover { 
    background: var(--primary-color); 
    color: #000; 
    box-shadow: 0 0 10px var(--primary-color);
}

#view-manage .page-header { margin-bottom: 0.6rem; }
#view-manage h1 { font-size: 1.5rem; }
#view-manage .subtitle { display: none; }
.managed-container { flex: 1; display: flex; flex-direction: column; gap: 1.5rem; }
#view-manage .card { padding: 0.8rem 1rem; margin-bottom: 0; flex: 1; }
#view-manage .section-title { margin-bottom: 0.5rem; font-size: 0.9rem; color: var(--primary-color); }

#view-manage .table-container { 
    flex: 1;
    min-height: 200px; /* Let flex dictate size without forcing overflow */
    border: 1px solid rgba(255,255,255,0.05);
    background: rgba(0,0,0,0.1);
    overflow-y: auto;
}
#view-manage .glass-table {
    height: 100%; /* Force table to fill available height */
}
#view-manage .glass-table th { 
    padding: 0.6rem 1rem; 
    font-size: 0.75rem; 
    background: rgba(0,0,0,0.4);
    text-align: center; /* Header center */
}
#view-manage .glass-table th:first-child { text-align: left; } /* Keep names left */

#view-manage .glass-table td { 
    padding: 0.4rem 1rem; 
    text-align: center; /* Cell center */
}
#view-manage .glass-table td:first-child { text-align: left; } /* Keep names left */

#view-manage .glass-input { 
    padding: 0.35rem 0.6rem; 
    font-size: 0.95rem; 
    border-radius: 4px; 
    background: rgba(255,255,255,0.03); 
    width: 110px; /* Compact width */
    margin: 0 auto;
    display: block;
    text-align: center; /* Number text center */
}

.compact-btn {
    padding: 0.5rem 1.25rem !important;
    font-size: 0.85rem !important;
    border-radius: 8px !important;
}
.compact-btn span { margin-right: 6px; }

#view-manage .row-total { color: var(--primary-color); font-weight: 800; font-size: 1.05rem; }
#view-manage .computed { opacity: 0.7; cursor: not-allowed; background: rgba(0,0,0,0.2); }

.text-mint { color: #00e676; text-shadow: 0 0 8px rgba(0,230,118,0.3); }

/* Column adjustments for better balance */
.entry-left .glass-table th:nth-child(2),
.entry-left .glass-table th:nth-child(3) { width: 140px; }
.entry-right .glass-table th:nth-child(2) { width: 140px; }

.glass-highlight td {
    background: rgba(189, 0, 255, 0.08);
    border-top: 1px solid var(--secondary-color);
}

/* Badges & Tags */
.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px; /* Crypto style squares */
    font-weight: 800;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.05);
}

.rank-1 { background: #facc15; color: #000; box-shadow: 0 0 15px rgba(250,204,21,0.5); }
.rank-2 { background: #cbd5e1; color: #000; box-shadow: 0 0 15px rgba(203,213,225,0.5); }
.rank-3 { background: #fb923c; color: #000; box-shadow: 0 0 15px rgba(251,146,60,0.5); }

.date-badge {
    padding: 0.3rem 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--primary-color);
    font-family: 'Inter', monospace;
}

.icon-tag {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.bg-indigo { background: var(--secondary-color); box-shadow: 0 0 10px var(--secondary-color); }
.bg-emerald { background: var(--success-color); box-shadow: 0 0 10px var(--success-color); }

/* --- Util and Misc --- */
.sys-pulse {
    background: linear-gradient(90deg, #00f3ff, #bd00ff, #00f3ff);
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 2s linear infinite;
    font-weight: 700;
}

.spinner {
    display: inline-block;
    width: 16px; height: 16px;
    border: 2px solid rgba(0,0,0,0.3);
    border-radius: 50%;
    border-top-color: #000;
    animation: spin 1s ease-in-out infinite;
    vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

.chart-container { position: relative; width: 100%; height: 300px; }
.pie-container { height: 300px; }

/* Custom Scrollbar Globally - Cyberpunk sleek */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 4px; border: 2px solid var(--bg-dark); }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 243, 255, 0.5); }

@media (max-width: 1200px) {
    .chart-row { flex-direction: column; }
    .flex-1, .flex-2 { flex: none; width: 100%; }
}

/* --- Thermal Matrix Layout --- */
.thermal-row { display: flex; margin-bottom: 6px; }
.thermal-label { 
    width: 140px; 
    color: var(--text-secondary); 
    font-size: 0.85rem; 
    padding-right: 15px; 
    text-align: right; 
    line-height: 20px; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
}
.thermal-months { display: flex; gap: 6px; }
.thermal-cell { 
    width: 32px; 
    height: 32px; 
    border-radius: 6px; 
    background: rgba(255,255,255,0.05); 
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.4s; 
    cursor: crosshair; 
    position: relative; 
}
.thermal-cell:hover { 
    transform: scale(1.3); 
    z-index: 10; 
    box-shadow: 0 0 15px rgba(0,243,255,0.6); 
}
.thermal-header-row { display: flex; margin-bottom: 15px; }
.thermal-header-spacer { width: 140px; padding-right: 15px; }
.thermal-header-month { 
    width: 32px; 
    text-align: center; 
    color: var(--text-secondary); 
    font-size: 0.85rem; 
    font-weight: bold; 
}

/* --- Sidebar Collapse for Fullscreen --- */
.sidebar { 
    transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s, padding 0.3s; 
    overflow: hidden; 
}
.sidebar.collapsed { 
    width: 0 !important; 
    opacity: 0 !important; 
    padding: 0 !important; 
    border: none !important; 
}

/* =========================================
   CUSTOM NATIVE COMPONENT OVERRIDES
========================================= */

/* Custom Select UI */
.custom-select-ui {
    position: relative;
    display: inline-block;
    min-width: 120px;
    user-select: none;
    z-index: 50;
}
.custom-select-trigger {
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.95rem;
    font-weight: 700;
    transition: all 0.2s ease;
}
.custom-select-trigger:hover, .custom-select-ui.open .custom-select-trigger {
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary-color);
}
.custom-select-options {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    width: fit-content;
    background: rgba(20, 20, 35, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(-6px);
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    padding: 0.4rem 0;
}
.custom-select-ui.open .custom-select-options {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
.custom-select-option {
    padding: 0.55rem 1.2rem;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.15s ease;
    margin: 0 0.4rem;
    border-radius: 8px;
    white-space: nowrap;
}
.custom-select-option:last-child {
    border-bottom: none;
}
.custom-select-option:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}
.custom-select-option.selected {
    color: var(--primary-color);
    background: rgba(0, 243, 255, 0.08);
    font-weight: 700;
}
.custom-select-optgroup-label {
    padding: 0.5rem 1.2rem;
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.3rem;
}

/* Hide Number Input Spinners */
input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
  appearance: none;
  -webkit-appearance: none; 
  margin: 0; 
}
input[type=number] {
  appearance: textfield;
  -moz-appearance: textfield;
}

/* Expansion Helper */
.view.active .flex-expand-card {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.view.active .flex-expand-card .chart-container {
    flex: 1;
    height: auto !important;
    min-height: 400px;
}
