/* ============================================================
   General Bots Cloud · Layout & Theme System
   Design: Monochrome — black & white
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ----------------------------------------------------------
   1. DESIGN TOKENS — Light (default)
   ---------------------------------------------------------- */

:root,
:root[data-theme="light"] {
  /* Surface */
  --bg:            #f8f8fa;
  --bg2:           #efefef;
  --bg3:           #e2e2e6;
  --surface:       #ffffff;
  --card:          #ffffff;

  /* Typography */
  --text:          #0c0c0e;
  --muted:         #64646e;

  /* Borders */
  --border:        rgba(0, 0, 0, 0.07);
  --border-hover:  rgba(0, 0, 0, 0.18);

  /* Accent palette */
  --accent:        #000000;
  --accent2:       #555555;
  --accent3:       #888888;
  --accent-dim:    rgba(255, 255, 255, 0.08);
  --accent-glow:   rgba(255, 255, 255, 0.15);

  /* Shadows */
  --shadow:        0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-accent: 0 0 0 3px var(--accent-glow);

  /* Topbar */
  --topbar-bg:     rgba(248, 248, 250, 0.82);

  /* Scrollbar */
  --scrollbar-thumb: rgba(0, 0, 0, 0.15);

  /* Accent — black */
  
  
  

  /* Radii */
  --radius:        14px;
  --radius-sm:     10px;

  /* Layout */
  --nav-w:         240px;
}

/* ----------------------------------------------------------
   2. DESIGN TOKENS — Dark (OS preference)
   ---------------------------------------------------------- */

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:            #08080a;
    --bg2:           #0e0e12;
    --bg3:           #17171d;
    --surface:       #111116;
    --card:          #0e0e12;

    --text:          #ededf0;
    --muted:         #7e7e8a;

    --border:        rgba(255, 255, 255, 0.07);
    --border-hover:  rgba(255, 255, 255, 0.18);

    --accent:        #ffffff;
    --accent2:       #aaaaaa;
    --accent3:       #888888;
    --accent-dim:    rgba(255, 255, 255, 0.08);
    --accent-glow:   rgba(255, 255, 255, 0.15);

    --shadow:        0 1px 4px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-accent: 0 0 0 3px var(--accent-glow);

    --topbar-bg:     rgba(8, 8, 10, 0.82);
    --scrollbar-thumb: rgba(255, 255, 255, 0.12);
  }
}

/* ----------------------------------------------------------
   3. DESIGN TOKENS — Dark (explicit)
   ---------------------------------------------------------- */

:root[data-theme="dark"] {
  --bg:            #08080a;
  --bg2:           #0e0e12;
  --bg3:           #17171d;
  --surface:       #111116;
  --card:          #0e0e12;

  --text:          #ededf0;
  --muted:         #7e7e8a;

  --border:        rgba(255, 255, 255, 0.07);
  --border-hover:  rgba(255, 255, 255, 0.18);

  --accent:        #ffffff;
  --accent2:       #aaaaaa;
  --accent3:       #888888;
  --accent-dim:    rgba(255, 255, 255, 0.08);
  --accent-glow:   rgba(255, 255, 255, 0.15);

  --shadow:        0 1px 4px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-accent: 0 0 0 3px var(--accent-glow);

  --topbar-bg:     rgba(8, 8, 10, 0.82);
  --scrollbar-thumb: rgba(255, 255, 255, 0.12);
}

/* ----------------------------------------------------------
   4. BASE RESET & TYPOGRAPHY
   ---------------------------------------------------------- */

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent);
  opacity: 0.85;
}

img {
  max-width: 100%;
  display: block;
}

/* ----------------------------------------------------------
   5. SCROLLBAR
   ---------------------------------------------------------- */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
}

/* ----------------------------------------------------------
   6. LAYOUT SHELL
   ---------------------------------------------------------- */

.mgmt-layout {
  min-height: 100vh;
  background: var(--bg);
}

.mgmt-shell {
  display: flex;
  min-height: 100vh;
}

/* ----------------------------------------------------------
   7. SIDEBAR
   ---------------------------------------------------------- */

.mgmt-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--nav-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.mgmt-sidebar::-webkit-scrollbar {
  display: none;
}

/* --- Logo --- */

.mgmt-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px 16px;
  text-decoration: none;
  color: var(--text);
  user-select: none;
}

.mgmt-logo-mark {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000000;
  flex-shrink: 0;
}

.mgmt-logo-icon {
  width: 20px;
  height: 20px;
  color: #fff;
  position: relative;
  z-index: 1;
}

.mgmt-logo-text {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.mgmt-logo-sub {
  display: block;
  font-weight: 500;
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 1px;
}

/* --- Navigation --- */

.mgmt-nav {
  flex: 1;
  padding: 4px 10px;
}

.mgmt-nav-section {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 18px 8px 6px;
  user-select: none;
}

.mgmt-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin: 1px 0;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all 0.15s ease;
  position: relative;
}

.mgmt-nav-link:hover {
  background: var(--accent-dim);
  color: var(--text);
  border-left-color: var(--accent);
}

.mgmt-nav-link.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}

/* Toggle (expandable nav items) */

.mgmt-nav-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin: 1px 0;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  border-left: 3px solid transparent;
  transition: all 0.15s ease;
}

.mgmt-nav-toggle:hover {
  background: var(--accent-dim);
  color: var(--text);
}

.mgmt-nav-toggle-arrow {
  width: 14px;
  height: 14px;
  margin-left: auto;
  transition: transform 0.2s ease;
  color: var(--muted);
  flex-shrink: 0;
}

.mgmt-nav-toggle[aria-expanded="true"] .mgmt-nav-toggle-arrow {
  transform: rotate(90deg);
}

/* Sub-navigation */

.mgmt-nav-sub {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
  padding-left: 14px;
}

.mgmt-nav-sub.open {
  max-height: 500px;
}

.mgmt-nav-sub-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 18px;
  margin: 1px 0;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: all 0.15s ease;
}

.mgmt-nav-sub-link:hover {
  background: var(--accent-dim);
  color: var(--text);
}

.mgmt-nav-sub-link.active {
  color: var(--accent);
}

/* Badge */

.mgmt-nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 99px;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  background: #000000;
  margin-left: auto;
  line-height: 1;
}

/* --- SVG Icon Sizing --- */

.mgmt-nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}

.mgmt-nav-link.active .mgmt-nav-icon {
  opacity: 1;
}

.mgmt-nav-sub-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.6;
}

/* --- Sidebar Footer --- */

.mgmt-sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.mgmt-user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}

.mgmt-user-chip:hover {
  background: var(--accent-dim);
}

.mgmt-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.mgmt-user-email {
  font-size: 0.8rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.mgmt-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.mgmt-logout:hover {
  color: var(--accent3);
  background: rgba(217, 48, 62, 0.08);
}

.mgmt-logout svg {
  width: 16px;
  height: 16px;
}

/* ----------------------------------------------------------
   8. MAIN CONTENT
   ---------------------------------------------------------- */

.mgmt-main {
  margin-left: var(--nav-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

/* ----------------------------------------------------------
   9. TOPBAR
   ---------------------------------------------------------- */

.mgmt-topbar {
  position: sticky;
  top: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 28px;
  background: var(--topbar-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

/* Topbar bottom line */
.mgmt-topbar::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: #000000;
  opacity: 0.6;
  pointer-events: none;
}

.mgmt-page-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.mgmt-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ----------------------------------------------------------
   10. ALPHA BADGE
   ---------------------------------------------------------- */

.mgmt-alpha-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #000000;
  color: #fff;
  line-height: 1.6;
}

/* ----------------------------------------------------------
   11. RESPONSIVE
   ---------------------------------------------------------- */

@media (max-width: 900px) {
  .mgmt-sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  .mgmt-sidebar.open {
    transform: translateX(0);
  }

  .mgmt-main {
    margin-left: 0;
  }
}
