/* css/layout.css */
#dashboard-grid {
    display: flex; padding: 40px calc(max(40px, 50vw - 800px)); gap: 40px; 
    align-items: stretch; flex: 1; min-height: 0; width: 100%; box-sizing: border-box;
}

.panel {
    background-color: rgba(24, 21, 18, 0.75) !important;
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(var(--theme-primary-rgb), 0.15); border-radius: 16px; 
    display: flex; flex-direction: column; overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.04); min-height: 0; 
}

#left-col { width: 200px; display: flex; flex-direction: column; gap: 20px; flex-shrink: 0; min-height: 0; height: 100%; }
#sidebar { padding: 20px 0 0 0; flex-grow: 1; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--theme-primary) transparent; display: flex; flex-direction: column; }
#sidebar::-webkit-scrollbar { width: 6px; }
#sidebar::-webkit-scrollbar-track { background: transparent; }
#sidebar::-webkit-scrollbar-thumb { background: var(--theme-primary); border-radius: 10px; }

#center-col { flex-grow: 1; min-height: 0; height: 100%; padding: 40px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--theme-primary) #181818; transition: opacity 0.2s ease-in-out; }
#center-col::-webkit-scrollbar { width: 6px; }
#center-col::-webkit-scrollbar-track { background: #181818; }
#center-col::-webkit-scrollbar-thumb { background: var(--theme-primary); border-radius: 10px; }

#right-col { width: 340px; display: flex; flex-direction: column; gap: 20px; flex-shrink: 0; min-height: 0; height: 100%; }
.panel-header { background-color: rgba(var(--theme-accent-rgb), 0.1); border-bottom: 1px solid var(--theme-primary); padding: 10px 15px; font-weight: bold; font-size: 12px; color: var(--theme-light); letter-spacing: 1px; }

.scrollable { overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--theme-primary) transparent; flex-grow: 1; padding: 15px; }
.scrollable::-webkit-scrollbar { width: 6px; }
.scrollable::-webkit-scrollbar-track { background: transparent; }
.scrollable::-webkit-scrollbar-thumb { background: var(--theme-primary); border-radius: 10px; }

.page-content { display: none; }
.page-content.active { display: flex; flex-direction: column; height: 100%; animation: quickFadeIn 0.3s forwards; }
@keyframes quickFadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.nav-btn { background: transparent; border: none; color: var(--theme-light); padding: 15px 20px; text-align: left; font-family: 'Noto Sans JP', sans-serif; font-size: 14px; font-weight: 700; cursor: pointer; transition: background-color 0.2s, color 0.2s; letter-spacing: 2px; flex-shrink: 0; }
.nav-btn:hover { color: #e8e8e8; background-color: rgba(var(--theme-accent-rgb), 0.1); }
.nav-btn.active { color: var(--theme-primary); background-color: rgba(var(--theme-accent-rgb), 0.15); }

#live-btn { height: 60px; flex-shrink: 0; background-color: #181818; display: flex; align-items: center; justify-content: center; cursor: not-allowed; border-color: #333; }
#live-btn.is-active { background-color: #ff5555 !important; border: 1px solid #ff8888; color: #111 !important; cursor: pointer; animation: livePulse 2s infinite; }
#live-btn.is-active span { color: #111 !important; }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 rgba(255, 85, 85, 0.7); } 70% { box-shadow: 0 0 0 15px rgba(255, 85, 85, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 85, 85, 0); } }

.legal-footer { margin-top: auto; text-align: center; padding: 15px 0; width: 100%; }
.legal-link { background: none; border: none; color: #555; font-size: 10px; font-weight: 700; letter-spacing: 1.5px; cursor: pointer; transition: color 0.2s; padding: 5px 10px; }
.legal-link:hover { color: var(--theme-primary); }

#mobile-menu-btn { display: none; }

/* === MOBILE LAYOUT FIXES === */
@media (max-width: 900px) {
    body { min-width: 0; } 
    #mobile-menu-btn { display: flex; align-items: center; justify-content: center; position: fixed; top: 15px; left: 15px; width: 48px; height: 48px; background: #110e0c; border: 1px solid var(--theme-primary); border-radius: 8px; color: var(--theme-primary); cursor: pointer; z-index: 300; padding: 0; }
    #dashboard-grid { padding: 15px; display: flex; flex-direction: column; width: 100%; gap: 15px; flex: 1; min-height: 0; position: relative; box-sizing: border-box; }
    #center-col { flex: 1 1 auto; min-height: 0; overflow-y: auto; width: 100%; padding: 20px; box-sizing: border-box; }
    #left-col { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(18, 18, 18, 0.95); backdrop-filter: blur(10px); z-index: 200; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; justify-content: center; align-items: center; }
    #left-col.menu-open { opacity: 1; pointer-events: auto; }
    #sidebar { background: transparent; border: none; align-items: center; width: 100%; }
    .nav-btn { text-align: center; font-size: 22px; padding: 15px; width: 100%; }
    #live-btn { display: none; }
    #right-col { position: absolute; top: 15px; bottom: 15px; left: 15px; right: 15px; width: auto; height: auto; pointer-events: none; }
}