/* Brand colors */
:root {
  --brand-primary: #051521;
  --brand-accent: #ea4236;
  --brand-bg: #fff;
  --brand-text: #222;
}

body {
  background: var(--brand-bg);
  color: var(--brand-text);
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  margin: 0;
  padding: 0;
}

.header {
  background: var(--brand-primary);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 2rem;
  height: 64px;
  box-shadow: 0 2px 8px rgba(5,21,33,0.05);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}
.header-logo {
  height: 40px;
  margin-right: 1.5rem;
}
.header-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.sidebar {
  background: var(--brand-primary);
  color: #fff;
  width: 240px;
  min-height: 100vh;
  position: fixed;
  top: 64px;
  left: 0;
  padding: 2rem 1rem 2rem 1rem;
  box-shadow: 2px 0 8px rgba(5,21,33,0.05);
}
.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.sidebar a {
  display: block;
  padding: 0.5em 0.8em;
  color: inherit;
  text-decoration: none;
  border-radius: 4px;
  margin: 0;
  transition: background 0.15s;
}
.sidebar a.active,
.sidebar a:hover {
  background: #c62828;
  color: #fff;
}

.sidebar-section {
  margin-top: 0;
  margin-bottom: 0;
}
.sidebar-section-title {
  font-weight: 500;
  padding: 0.5em 0.8em 0.5em 0.8em;
  color: #fff;
  font-size: 1em;
  background: none;
  border-radius: 4px;
  margin: 0;
}
.sidebar-section-title.accordion-toggle {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  width: 100%;
  text-align: left;
  padding: 0.5em 0.8em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 4px;
  transition: background 0.15s;
}
.sidebar-section-title.accordion-toggle:focus {
  outline: 2px solid var(--brand-accent);
}
.accordion-arrow {
  display: inline-block;
  transition: transform 0.2s;
  margin-left: 0.5em;
}
.sidebar-section.open .accordion-arrow {
  transform: rotate(90deg);
}
.accordion-content[hidden] {
  display: none;
}
.sidebar-submenu {
  list-style: none;
  margin: 0 0 0 0.7em;
  padding: 0;
}
.sidebar-submenu li {
  margin: 0;
}
.sidebar-submenu a {
  display: block;
  padding: 0.5em 0.8em;
  color: inherit;
  text-decoration: none;
  border-radius: 4px;
  transition: background 0.15s;
  margin-left: 0.5em;
}
.sidebar-submenu a:hover,
.sidebar-submenu a.active {
  background: #c62828;
  color: #fff;
}

.main {
  margin-left: 260px;
  padding: 2.5rem 2.5rem 2.5rem 2.5rem;
  margin-top: 64px;
  min-height: calc(100vh - 72px);
  background: var(--brand-bg);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(5,21,33,0.04);
}

@media (max-width: 900px) {
  .sidebar {
    width: 180px;
    padding: 1rem 0.5rem 1rem 0.5rem;
  }
  .main {
    margin-left: 190px;
    padding: 1.5rem 1rem 1.5rem 1rem;
    margin-top: 24px;
  }
}
@media (max-width: 600px) {
  .header {
    flex-direction: row;
    height: 56px;
    padding: 0 1rem;
    align-items: center;
  }
  .header-logo {
    height: 32px;
    margin-right: 1rem;
  }
  .header-title {
    font-size: 1.1rem;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 80vw;
    max-width: 320px;
    min-width: 180px;
    height: 100vh;
    min-height: 100vh;
    z-index: 2000;
    background: var(--brand-primary);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(.4,0,.2,1);
    box-shadow: 2px 0 16px rgba(5,21,33,0.12);
    padding: 2rem 1rem 2rem 1rem;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar nav {
    gap: 0.7rem;
  }
  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.25);
    z-index: 1500;
  }
  .sidebar.open + .sidebar-overlay {
    display: block;
  }
  .main {
    margin-left: 0;
    margin-top: 56px;
    padding: 1rem 0.5rem 1rem 0.5rem;
    border-radius: 0;
    box-shadow: none;
  }
}

/* Hamburger button */
.hamburger {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  margin-right: 1rem;
  cursor: pointer;
  z-index: 2100;
}
@media (max-width: 600px) {
  .hamburger {
    display: block;
  }
}

/* Hide sidebar by default on mobile */
@media (max-width: 600px) {
  .sidebar {
    display: block;
  }
}

/* Improve touch targets and spacing on mobile */
@media (max-width: 600px) {
  .sidebar a, .sidebar-section-title {
    font-size: 1.05em;
    padding: 0.9em 1em;
  }
  .sidebar-submenu a {
    margin-left: 0.7em;
  }
}

/* Utility: prevent scroll when sidebar is open */
body.sidebar-open {
  overflow: hidden;
}

/* Accent elements */
a, .accent {
  color: var(--brand-accent);
}
code, pre {
  background: #f5f5f5;
  border-radius: 4px;
  padding: 0.2em 0.4em;
  font-size: 0.95em;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(5,21,33,0.04);
}
table th, table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}
table th {
  background: var(--brand-primary);
  color: #fff;
  font-weight: 600;
}
table tr:last-child td {
  border-bottom: none;
}
table tr:nth-child(even) td {
  background: #f8fafc;
}

pre, code {
  font-family: 'Fira Mono', 'Consolas', 'Menlo', monospace;
  font-size: 1em;
}
pre {
  background: #f5f5f5;
  border-radius: 6px;
  padding: 1rem;
  margin: 1.5rem 0;
  overflow-x: auto;
}

code {
  line-height: 25px;
}