@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
  --font-mono: 'JetBrains Mono', monospace;
  --font-sans: 'DM Sans', sans-serif;
  --sidebar-width: 216px;
  --sidebar-gap: 0.5rem;

  --bg-deep: #f2f2f2;
  --bg-surface: #f8f8f8;
  --bg-card: #ffffff;
  --bg-card-hover: #f5f5f5;
  --bg-elevated: #eeeeee;
  --border: #e0e0e0;
  --border-subtle: #eaeaea;
  --text-primary: #1a1a1a;
  --text-secondary: #666666;
  --text-muted: #aaaaaa;
  --accent-green: #1a9950;
  --accent-blue: #c88a1a;
  --accent-blue-dim: #faf0e0;
  --accent-red: #cc3333;
  --dot-color: #ddd;
  --radius: 8px;
  --radius-sm: 5px;
}

[data-theme='dark'] {
  --bg-deep: #0c0c0c;
  --bg-surface: #111111;
  --bg-card: #161616;
  --bg-card-hover: #1e1e1e;
  --bg-elevated: #1a1a1a;
  --border: #2a2a2a;
  --border-subtle: #1f1f1f;
  --text-primary: #d4d4d4;
  --text-secondary: #777777;
  --text-muted: #444444;
  --accent-green: #3cba6f;
  --accent-blue: #e8a838;
  --accent-blue-dim: #2b2214;
  --accent-red: #e85454;
  --dot-color: #1a1a1a;
}

html, body, #app {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-deep) !important;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(circle, var(--dot-color) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: .7;
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

.glass-container {
  min-height: 100vh;
  box-sizing: border-box;
  padding: var(--sidebar-gap) var(--sidebar-gap) var(--sidebar-gap) calc(var(--sidebar-width) + 2 * var(--sidebar-gap));
  display: flex;
  flex-direction: column;
  background: transparent !important;
}

.glass-main {
  flex: 1 1 auto;
  min-height: 0;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.layout-body {
  min-height: 0;
  background: transparent !important;
}

.sidebar-nav,
.sidebar,
.glass-sidebar {
  width: var(--sidebar-width);
  height: calc(100vh - 2 * var(--sidebar-gap));
  position: fixed;
  top: var(--sidebar-gap);
  left: var(--sidebar-gap);
  z-index: 1040;
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0;
  background: var(--bg-surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: 12px !important;
  box-shadow: 0 6px 20px rgba(0,0,0,.26) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 0.85rem 0.7rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 0.35rem;
}

.brand-logo-shell {
  position: relative;
  width: 104px;
  height: 104px;
  min-width: 104px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border);
  overflow: hidden;
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  padding: 5px;
}

.brand-title {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--text-primary);
}

.brand-title .accent { color: var(--accent-blue); }

.nav-sections {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}

.section-label {
  margin: .4rem 0 .15rem;
  padding: 0 1rem;
  list-style: none;
  text-transform: uppercase;
  font-family: var(--font-mono);
  font-size: .62rem;
  letter-spacing: .11em;
  color: var(--text-muted);
}

.section-details { margin: 0; padding: 0; }
.section-details summary { list-style: none; }
.section-details summary::-webkit-details-marker { display: none; }
.section-label-collapsible { cursor: pointer; display: flex; align-items: center; gap: .35rem; }
.section-chevron { font-size: .6rem; transition: transform .2s ease; }
.section-details[open] .section-chevron { transform: rotate(90deg); }
.section-details-items { margin: 0; padding: 0; list-style: none; }

.sidebar-nav .nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0 .5rem;
  padding: .42rem .7rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  color: var(--text-secondary) !important;
  font-family: var(--font-mono);
  font-size: .72rem;
  text-decoration: none !important;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.sidebar-nav .nav-item i { font-size: .9rem; opacity: .8; color: var(--text-muted); }
.sidebar-nav .nav-item:hover { background: var(--bg-card); color: var(--text-primary) !important; transform: none !important; }
.sidebar-nav .nav-item.active { background: var(--bg-card); color: var(--text-primary) !important; border-color: var(--border); }
.sidebar-nav .nav-item.active::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--accent-blue);
}

.notif-badge {
  position: absolute;
  top: 50%;
  right: .7rem;
  transform: translateY(-50%);
  background: var(--accent-red);
  color: #fff;
  font-size: .65rem;
  font-family: var(--font-mono);
  border-radius: 999px;
  padding: 0 6px;
}

.sidebar-footer { margin-top: auto; border-top: 1px solid var(--border-subtle); }
.sidebar-footer-version { font-size: .68rem; font-family: var(--font-mono); color: var(--text-muted); }
.sidebar-theme-toggle {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-secondary) !important;
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.sidebar-theme-toggle:hover { background: var(--bg-card-hover); color: var(--text-primary) !important; border-color: var(--text-muted); }
.sidebar-theme-toggle .theme-icon-dark { display: none; }
[data-theme='dark'] .sidebar-theme-toggle .theme-icon-dark { display: inline-block; }
[data-theme='dark'] .sidebar-theme-toggle .theme-icon-light { display: none; }

.dashboard-wrapper { display: flex; flex-direction: column; min-height: 0; padding: .5rem; padding-bottom: 1.5rem; gap: .75rem; }
.no-outer-scroll { height: calc(100vh - 2 * var(--sidebar-gap)); min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.glass-tile { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; border-radius: var(--radius); background: var(--bg-card); border: 1px solid var(--border); }

.mobile-toggle-container {
  display: none !important;
}

.mobile-menu-toggle {
  min-height: 42px;
  min-width: 42px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 768px) {
  .sidebar-nav, .sidebar, .glass-sidebar {
    transform: translateX(calc(-1 * var(--sidebar-width) - 2 * var(--sidebar-gap)));
    transition: transform .25s cubic-bezier(0.4,0,0.2,1);
    z-index: 2000;
    pointer-events: none;
  }

  .sidebar-nav.sidebar-visible, .sidebar.sidebar-visible, .glass-sidebar.sidebar-visible {
    transform: translateX(0);
    pointer-events: auto;
  }

  .glass-container { padding-left: var(--sidebar-gap) !important; }
  .mobile-toggle-container {
    display: flex !important;
    justify-content: flex-start;
    padding: .75rem .75rem 0;
  }
  body.sidebar-open::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.3);
    z-index: 1999;
  }
}
