/* ================================
   VARIABLES
================================ */

:root {
  --bg: #0d0c10;
  --bg-2: #15131b;
  --panel: rgba(30, 26, 38, 0.82);
  --border: rgba(214, 195, 255, 0.12);

  --text: #f3eef8;
  --muted: #b7aec8;

  --accent: #c5a7ff;
  --accent-soft: rgba(197, 167, 255, 0.08);

  --shadow: rgba(0, 0, 0, 0.32);
  --soft-line: rgba(255, 255, 255, 0.05);
}


/* ================================
   BASE / RESET
================================ */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: Verdana, Tahoma, sans-serif;
  background:
    radial-gradient(circle at top, rgba(140, 110, 220, 0.08), transparent 30%),
    radial-gradient(circle at bottom, rgba(110, 80, 170, 0.08), transparent 28%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  color: var(--text);
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* ================================
   SCROLLBARS
================================ */

.sidebar,
.main-column,
.right-column,
.log-panel .log {
  scrollbar-width: thin;
  scrollbar-color: rgba(197, 167, 255, 0.22) transparent;
}

.sidebar::-webkit-scrollbar,
.main-column::-webkit-scrollbar,
.right-column::-webkit-scrollbar,
.log-panel .log::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-track,
.main-column::-webkit-scrollbar-track,
.right-column::-webkit-scrollbar-track,
.log-panel .log::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb,
.main-column::-webkit-scrollbar-thumb,
.right-column::-webkit-scrollbar-thumb,
.log-panel .log::-webkit-scrollbar-thumb {
  background: rgba(197, 167, 255, 0.18);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.sidebar::-webkit-scrollbar-thumb:hover,
.main-column::-webkit-scrollbar-thumb:hover,
.right-column::-webkit-scrollbar-thumb:hover,
.log-panel .log::-webkit-scrollbar-thumb:hover {
  background: rgba(197, 167, 255, 0.28);
  background-clip: padding-box;
}

/* ================================
   FRAME
================================ */

.main-frame {
  width: min(1320px, calc(100vw - 48px));
  height: min(860px, calc(100vh - 48px));
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--panel);
  backdrop-filter: blur(10px);
  box-shadow:
    0 14px 50px var(--shadow),
    0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}


/* ================================
   LAYOUT
================================ */

.main-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 260px;
  flex: 1;
  min-height: 0;
}

.sidebar,
.main-column,
.right-column {
  padding: 24px;
  min-height: 0;
  overflow-y: auto;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-right: 1px solid var(--soft-line);
}

.main-column {
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
   
}

.right-column {
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-left: 1px solid var(--soft-line);
}

.left-actions,
.right-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}

.left-actions {
  margin-top: 4px;
}

.right-actions {
  flex: 1;
  justify-content: center;
}

.side-bottom {
  margin-top: auto;
}


/* ================================
   MODULE CONTAINER
================================ */

.module-container {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.module-fallback,
.home-view {
  position: relative;
  width: 100%;
  height: 100%;
}

.module-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  color: var(--muted);
}

.module-error h2 {
  margin: 0 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.1rem;
  text-transform: uppercase;
}


/* ================================
   TOPBAR ACTION
================================ */

.logout-button {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid rgba(197, 167, 255, 0.12);
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease;
}

.logout-button:hover {
  background: rgba(197, 167, 255, 0.14);
  color: var(--text);
}


/* ================================
   PANELS
================================ */

.panel {
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(30, 26, 38, 0.62);
  border: 1px solid var(--soft-line);
}

.status-panel,
.presence-panel,
.log-panel {
  background: var(--accent-soft);
  border: 1px solid rgba(197, 167, 255, 0.10);
}

.panel-heading {
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(183, 174, 200, 0.14);
}

.panel-heading .section-title {
  margin: 0;
  color: #b7aec8;
}

.panel-text {
  margin: 0 0 8px;
  color: rgba(243, 238, 248, 0.74);
  line-height: 1.45;
  font-size: 0.92rem;
}


/* ================================
   STATUS PANEL
================================ */

.status-panel {
  padding: 12px 16px;
}

.status-panel .panel-heading {
  margin-bottom: 6px;
  padding-bottom: 6px;
}

.status-panel .panel-text {
  margin: 0 0 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  line-height: 1.4;
  color: rgba(243, 238, 248, 0.70);
}


/* ================================
   TERMINAL
================================ */

.terminal-panel {
  flex-shrink: 0;
  min-height: 270px;
  padding: 18px 20px;
  background: rgba(18, 17, 22, 0.82);
  border: 1px solid rgba(197, 167, 255, 0.18);
  overflow: hidden;
}

.terminal-output {
  height: 220px;
  overflow-y: auto;
  padding-right: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--muted);
  scrollbar-width: thin;
  scrollbar-color: rgba(197, 167, 255, 0.3) transparent;
}

.terminal-output::-webkit-scrollbar {
  width: 6px;
}

.terminal-output::-webkit-scrollbar-track {
  background: transparent;
}

.terminal-output::-webkit-scrollbar-thumb {
  background: rgba(197, 167, 255, 0.25);
  border-radius: 999px;
}

.console-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
  white-space: pre-wrap;
  word-break: break-word;
}

.console-tag {
  flex: 0 0 auto;
  font-weight: 600;
  letter-spacing: 0.08em;
  opacity: 0.95;
}

.console-line.sys .console-tag {
  color: #c5a7ff;
}

.console-line.nav .console-tag {
  color: #8bb8ff;
}

.console-line.tip .console-tag {
  color: #9ee7d7;
}

.console-text {
  color: rgba(243, 238, 248, 0.78);
}

.terminal-cursor {
  display: inline-block;
  width: 0.65ch;
  margin-left: 2px;
  color: var(--accent);
  animation: terminalBlink 1s step-end infinite;
}

@keyframes terminalBlink {
  0%, 49% {
    opacity: 1;
  }
  50%, 100% {
    opacity: 0;
  }
}


/* ================================
   NAVIGATION BUTTONS
================================ */

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-nav a,
.sidebar-button {
  display: block;
  width: 100%;
  padding: 4px 0;
  background: transparent;
  border: 0;
  color: #b7aec8;
  text-decoration: none;
  text-align: center;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 160ms ease, text-shadow 160ms ease;
}

.sidebar-nav a:hover,
.sidebar-button:hover {
  color: #f3eef8;
  text-shadow: 0 0 10px rgba(197, 167, 255, 0.20);
}

.action-panel {
  padding-top: 8px;
  padding-bottom: 8px;
  background: var(--accent-soft);
  border: 1px solid rgba(197, 167, 255, 0.10);
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.action-panel:hover {
  background: rgba(197, 167, 255, 0.12);
  border-color: rgba(197, 167, 255, 0.16);
  box-shadow: 0 0 14px rgba(197, 167, 255, 0.06);
}


/* ================================
   PRESENCE
================================ */

.presence-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.presence-item {
  display: inline-block;
  padding: 0;
  background: transparent;
  border: 0;
  color: rgba(243, 238, 248, 0.74);
  text-decoration: none;
  cursor: pointer;
  font-size: 0.74rem;
  line-height: 1.35;
  transition: color 160ms ease, text-shadow 160ms ease;
}

.presence-item:hover {
  color: #f3eef8;
  text-shadow: 0 0 10px rgba(197, 167, 255, 0.18);
}


/* ================================
   LOG PANEL
================================ */

.log-panel {
  flex-shrink: 0;
}

.log-panel .log {
  max-height: 220px;
  padding-right: 4px;
}

.log-panel .entry-main {
  padding: 8px 10px;
  background: rgba(30, 26, 38, 0.62);
  border: 1px solid rgba(197, 167, 255, 0.08);
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.log-panel .entry-main .timestamp {
  font-size: 0.62rem;
}

.log-panel .entry-main .entry-text {
  font-size: 0.72rem;
  line-height: 1.4;
}


/* ================================
   HOME VIEW / CENTER LOGO
================================ */

.main-background-logo {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  pointer-events: none;
  z-index: 0;
}

.main-background-logo img {
  width: min(74%, 680px);
  height: auto;
  max-width: 100%;
  max-height: 86%;
  object-fit: contain;
  opacity: 0.14;
  filter: drop-shadow(0 0 20px rgba(197, 167, 255, 0.08));
  user-select: none;
}



/* ================================
   RESPONSIVE
================================ */

@media (max-width: 1080px) {
  body {
    align-items: flex-start;
  }

  .main-frame {
    width: min(1320px, calc(100vw - 32px));
    height: auto;
    min-height: calc(100vh - 32px);
  }

  .main-layout {
    grid-template-columns: 1fr;
  }

  .sidebar,
  .right-column {
    border: 0;
  }

  .sidebar {
    border-bottom: 1px solid var(--soft-line);
  }

  .right-column {
    border-top: 1px solid var(--soft-line);
  }

  .side-bottom {
    margin-top: 0;
  }

  .right-actions {
    flex: unset;
    justify-content: flex-start;
  }
}

@media (max-width: 820px) {
  body {
    padding: 16px;
  }

  .main-frame {
    width: calc(100vw - 32px);
    min-height: calc(100vh - 32px);
  }

  .sidebar,
  .main-column,
  .right-column {
    padding: 18px;
  }

  .boards-view {
    padding: 24px 10px 30px;
  }
}
