:root {
  --bg: #0b1820;
  --bg-elevated: #102129;
  --accent: #f64d16;
  --accent-soft: rgba(246, 77, 22, 0.15);
  --border: #23414c;
  --text-main: #ffffff;
  --text-muted: #9fb2c0;
  --danger: #ff4966;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-pill: 999px;
  --shadow-soft: 0 16px 40px rgba(0, 0, 0, 0.4);
  --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

body {
  margin: 0;
  font-family: var(--font-main);
  background: radial-gradient(circle at top left, #23414c 0, #0b1820 50%, #02070b 100%);
  color: var(--text-main);
}

.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-template-rows: 60px 1fr;
  min-height: 100vh;
}

.app-header {
  grid-column: 1 / 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.2rem;
  background: rgba(3, 93, 99, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.app-title {
  display: flex;
  flex-direction: column;
}

.app-title-main {
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.9rem;
}

.app-title-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-email {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.burger-btn {
  border: none;
  background: transparent;
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  margin-right: 0.5rem;
  cursor: pointer;
}

.burger-btn span {
  width: 18px;
  height: 2px;
  background: #ffffff;
  border-radius: 999px;
}

/* Sidebar */
.sidebar {
  grid-row: 2 / 3;
  background: rgba(10, 24, 32, 0.95);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  padding: 1.2rem 0.9rem;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.nav-link {
  text-align: left;
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-link.active {
  background: var(--accent-soft);
  color: var(--text-main);
}

/* Main */
.app-main {
  grid-row: 2 / 3;
  padding: 1.2rem 1.6rem 2rem;
  overflow-y: auto;
}

.page {
  display: none;
  max-width: 960px;
  margin: 0 auto;
}

.page.visible {
  display: block;
}

h1, h2, h3 {
  margin-top: 0;
}

.muted {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Cards & forms */
.card {
  margin-top: 1rem;
  padding: 1rem 1.2rem;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.form-group {
  margin-bottom: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

input[type="email"],
input[type="password"],
input[type="text"],
textarea,
input[type="file"] {
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 0.5rem 0.6rem;
  font-size: 0.9rem;
  background: rgba(7, 21, 28, 0.95);
  color: var(--text-main);
}

textarea {
  resize: vertical;
  min-height: 140px;
}

/* Buttons */
.btn {
  border-radius: var(--radius-pill);
  padding: 0.45rem 1.1rem;
  font-size: 0.85rem;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.btn.primary {
  background: var(--accent);
  color: #fff;
}

.btn.primary:hover {
  filter: brightness(1.05);
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-main);
}

.btn.small {
  font-size: 0.8rem;
  padding: 0.35rem 0.8rem;
}

.btn.full {
  width: 100%;
}

.status {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.error {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--danger);
}

.hidden {
  display: none !important;
}

/* Code block */
.code-block {
  background: #02070b;
  border-radius: 12px;
  padding: 0.8rem;
  font-size: 0.8rem;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.result-block {
  margin-top: 0.7rem;
}

/* Responsive */
@media (max-width: 768px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: 60px auto;
  }

  .sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    width: 230px;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 10;
  }

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

  .app-main {
    padding: 1rem;
  }
}