/* ======================================================
   base.css — AWK-style foundation
   ====================================================== */

/* ---------- CSS Variables ---------- */
:root {
  --menu-width: 20%;
  --dev-height: 15%;

  --bg-main: #f5f6f8;
  --bg-menu: #1e1f24;
  --bg-content: #ffffff;
  --bg-dev: #0f1115;

  --text-light: #eaeaea;
  --text-dark: #222;

  --border-soft: #dcdcdc;
  --border-hard: #2a2a2a;

  --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
  background: var(--bg-main);
  color: var(--text-dark);
}

/* ---------- App Shell ---------- */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ---------- Main Area (Menu + Content) ---------- */
.main {
  display: flex;
  flex: 1 1 auto;
  min-height: 0; /* critical for scroll containment */
}

/* ======================================================
   Menu
   ====================================================== */

/* ---------- Menu Container ---------- */
.menu {
  position: relative;
  width: var(--menu-width);
  background: var(--bg-menu);
  color: #cccccc; /* ~80% grayscale */
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem;
  overflow-y: auto;
  border-right: 1px solid var(--border-hard);
}

/* ---------- Menu Logo ---------- */
.menu-logo {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  padding: 0.5rem 0.5rem 0.75rem;
  background: var(--bg-menu);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 0.5rem;
}

.menu-logo-img {
  max-width: 100%;
  max-height: 40px;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.15s ease;
}

.menu-logo-img:hover {
  opacity: 1;
}

/* ---------- Menu Groups ---------- */
.menu-group {
  margin-bottom: 0.5rem;
}

.menu-header {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9a9a9a; /* ~70% grayscale */
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  user-select: none;
}

.menu-header:hover {
  color: #e7e7e7;
}

.menu-items {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.menu-group.collapsed .menu-items {
  display: none;
}

/* ---------- Menu Links ---------- */
.menu a {
  display: block;
  padding: 0.5rem 0.75rem;
  text-decoration: none;
  color: #cccccc;
  font-weight: 400;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
}

/* Numbers / emphasis inside links */
.menu a strong,
.menu a b,
.menu a span {
  color: #1a1a1a; /* ~10% grayscale */
  font-weight: 700;
}

/* Hover */
.menu a:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.menu a:hover strong,
.menu a:hover b,
.menu a:hover span {
  color: #e6e6e6; /* ~90% grayscale */
}

/* Active */
.menu a.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  font-weight: 600;
}

/* ======================================================
   Content
   ====================================================== */

.content {
  flex: 1 1 auto;
  background: var(--bg-content);
  overflow-y: auto;
  padding: 1rem;
}

/* ======================================================
   Dev / Console Panel
   ====================================================== */

.dev {
  height: var(--dev-height);
  background: var(--bg-dev);
  color: var(--text-light);
  border-top: 1px solid var(--border-hard);
  overflow-y: auto;
  font-family: monospace;
  font-size: 0.9rem;
  padding: 0.5rem;
}

/* ======================================================
   Utility Classes
   ====================================================== */

.hidden {
  display: none !important;
}

.scroll {
  overflow-y: auto;
}

.center {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Debug Helpers (optional) ---------- */
/*
.menu    { outline: 1px solid red; }
.content { outline: 1px solid blue; }
.dev     { outline: 1px solid green; }
*/