:root {
  --bg: #1a1a1a;
  --card-bg: #252525;
  --text: #e0e0e0;
  --muted: #888;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --border: #333;
  --success: #22c55e;
  --topbar-height: 60px;
}

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

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: inherit;
}

.topbar {
  background: var(--card-bg);
  height: var(--topbar-height);
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--accent);
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
}

.brand {
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 1px;
  color: #fff;
  display: flex;
  align-items: center;
}

.brand i {
  margin-right: 8px;
  color: var(--accent);
  font-size: 1.05em;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.2s;
}

.btn:hover {
  background: var(--accent-hover);
}

.sidebar-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #1f1f1f;
  color: #fff;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-right: 10px;
}

.sidebar-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 40;
}

body.sidebar-open {
  overflow: hidden;
}

@media (max-width: 768px) {
  .topbar {
    padding: 0 12px;
  }

  .sidebar-toggle {
    display: inline-flex;
  }

  .layout {
    position: relative;
  }

  .sidebar {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    width: min(84vw, 320px);
    height: calc(100vh - var(--topbar-height));
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    overflow-y: auto;
  }

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

@media (hover: none) and (pointer: coarse) {
  .btn:hover {
    background: var(--accent);
  }

  .btn:active {
    background: var(--accent-hover);
  }
}
