:root {
  --navy: #0c1a3e;
  --navy-light: #16265a;
  --blue: #3b5bfd;
  --blue-light: #eef1ff;
  --text: #1f2430;
  --muted: #6b7280;
  --border: #e5e7eb;
  --bg: #f7f8fb;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Top bar */
.topbar {
  background: var(--navy);
  color: #fff;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: #fff;
}

.topbar .brand .logo {
  width: 32px;
  height: 32px;
  background: #fff;
  color: var(--navy);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.topbar .brand:hover { text-decoration: none; }

.topbar nav a {
  color: #cdd5f0;
  margin-left: 22px;
  font-size: 14px;
  font-weight: 500;
}

.topbar nav a:hover, .topbar nav a.active {
  color: #fff;
  text-decoration: none;
}

.topbar .search-box {
  display: flex;
  align-items: center;
}

.topbar input[type="search"] {
  border: 1px solid var(--navy-light);
  background: var(--navy-light);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  width: 220px;
}

.topbar input[type="search"]::placeholder { color: #9aa6cc; }

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, #1c2e6e 100%);
  color: #fff;
  padding: 56px 24px;
  text-align: center;
}

.hero h1 {
  font-size: 34px;
  margin: 0 0 12px;
}

.hero p {
  color: #cdd5f0;
  font-size: 16px;
  max-width: 620px;
  margin: 0 auto 24px;
}

.hero .search-box input {
  width: 100%;
  max-width: 480px;
  padding: 14px 18px;
  border-radius: 10px;
  border: none;
  font-size: 15px;
}

/* Layout */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 36px;
}

@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; }
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 70px;
  align-self: start;
}

@media (max-width: 800px) {
  .sidebar {
    position: static;
    top: auto;
    align-self: auto;
  }
}

.sidebar h4 {
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 18px 0 8px;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar li a {
  display: block;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
}

.sidebar li a:hover {
  background: var(--blue-light);
  text-decoration: none;
}

.sidebar li a.active {
  background: var(--blue-light);
  color: var(--blue);
  font-weight: 600;
}

.nav-icon {
  display: inline-flex;
  vertical-align: -4px;
  margin-right: 8px;
  color: var(--muted);
}

.nav-icon svg {
  width: 17px;
  height: 17px;
}

.sidebar li a.active .nav-icon {
  color: var(--blue);
}

/* Cards / grid for homepage */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 32px;
}

@media (max-width: 800px) {
  .cat-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .cat-grid { grid-template-columns: 1fr; }
}

.cat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: box-shadow .15s, transform .15s;
}

.cat-card:hover {
  box-shadow: 0 6px 18px rgba(12,26,62,0.08);
  transform: translateY(-2px);
  text-decoration: none;
}

.cat-card .icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--blue-light);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.cat-card .icon svg {
  width: 22px;
  height: 22px;
}

.cat-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
  color: var(--text);
}

.cat-card p {
  margin: 0;
  font-size: 13.5px;
  color: var(--muted);
}

/* Article content */
.article {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 40px;
}

.article h1 {
  margin-top: 0;
  font-size: 28px;
}

.article h2 {
  font-size: 20px;
  margin-top: 32px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.article h3 {
  font-size: 16px;
  margin-top: 24px;
}

.article p, .article li { color: #333; font-size: 15px; }

.article ul, .article ol {
  padding-left: 22px;
}

.breadcrumbs {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
}

.callout {
  background: var(--blue-light);
  border-left: 4px solid var(--blue);
  border-radius: 6px;
  padding: 12px 16px;
  margin: 18px 0;
  font-size: 14px;
}

.callout.tip::before {
  content: "Tip: ";
  font-weight: 700;
}

.callout.note::before {
  content: "Note: ";
  font-weight: 700;
}

code {
  background: #f1f3f9;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 13px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}

th, td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
}

th {
  background: #f7f8fb;
}

.pager {
  display: flex;
  justify-content: space-between;
  margin-top: 32px;
  font-size: 14px;
}

footer {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 24px;
  border-top: 1px solid var(--border);
}

/* Mobile tweaks */
@media (max-width: 600px) {
  .topbar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
  }

  .topbar .brand {
    font-size: 16px;
  }

  .topbar nav a {
    margin-left: 0;
    margin-right: 14px;
  }

  .hero {
    padding: 36px 16px;
  }

  .hero h1 {
    font-size: 24px;
  }

  .hero p {
    font-size: 14px;
  }

  .container {
    padding: 20px 12px 40px;
  }

  .article {
    padding: 20px;
  }

  .article h1 {
    font-size: 22px;
  }

  table, thead, tbody, th, td, tr {
    display: block;
  }

  table {
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
  }

  th {
    display: none;
  }

  td {
    border: none;
    border-bottom: 1px solid var(--border);
    padding: 10px 12px;
  }

  td:first-child {
    font-weight: 700;
    padding-bottom: 2px;
    border-bottom: none;
  }

  tr:last-child td:last-child {
    border-bottom: none;
  }
}
