/* ─── Variables ─────────────────────────────────────────────────────────────── */
:root {
  /* Z-depth grayscale: higher = brighter "upon" effect */
  --z0: #000000;  /* body (deepest) */
  --z1: #0f0f0f;  /* main frames */
  --z2: #1c1c1c;  /* headers, sub-frames */
  --z3: #2a2a2a;  /* cards, lists */
  --z4: #383838;  /* elevated surfaces (modals) */
  --z5: #464646;  /* interactive elements (inputs, buttons) */
  
  --text-main: #ffffff;
  --text-dim:  #b0b0b0;
  --border:    #404040;
  
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  
  --radius: 0.5rem;
}

/* ─── Reset & Base ──────────────────────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--z0);
  color: var(--text-main);
  font-family: system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
}

/* ─── Layer 1: Main Frames ──────────────────────────────────────────────────── */
#home-frame,
#proj-content {
  background: var(--z1);
  min-height: 100vh;
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* ─── Layer 2: Navigation / Headers ─────────────────────────────────────────── */
#proj-header {
  background: var(--z2);
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  position: sticky;
  top: 0;
  z-index: 10;
}

#view-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  justify-content: center;
}

/* ─── Layer 3: Content Containers ───────────────────────────────────────────── */
#proj-content > div {
  background: var(--z2);
  border-radius: var(--radius);
  padding: var(--space-md);
  flex: 1;
  overflow: auto;
}

/* Tables */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--z3);
  border-radius: var(--radius);
  overflow: hidden;
}

thead { background: var(--z2); }

th, td {
  padding: var(--space-sm) var(--space-md);
  text-align: center;
  border-bottom: 1px solid var(--border);
}

tbody tr {
  background: var(--z3);
  transition: background 0.15s ease;
}

tbody tr:hover { background: var(--z4); }

/* ─── Layer 4: Cards & Items ────────────────────────────────────────────────── */
/* Project cards on home */
#home-frame > div {
  background: var(--z3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-md);
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: var(--space-md);
  align-items: center;
  transition: transform 0.2s ease, background 0.2s ease;
}

#home-frame > div:hover {
  background: var(--z4);
  transform: translateY(-2px);
}

/* Kanban & Status Board columns */
#proj-content > div[style*="flex"] > div {
  background: var(--z2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-md);
  min-width: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

/* Cards inside columns */
#proj-content > div[style*="flex"] > div > div {
  background: var(--z3);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) / 2);
  padding: var(--space-sm);
  cursor: pointer;
  transition: background 0.15s;
}

#proj-content > div[style*="flex"] > div > div:hover {
  background: var(--z4);
}

/* Status Manager list items */
#status-list > div {
  background: var(--z3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-sm) var(--space-md);
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto auto;
  gap: var(--space-sm);
  align-items: center;
}

/* ─── Layer 5: Overlays (Modals) ────────────────────────────────────────────── */
#item-form-overlay,
#status-manager-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center; /* perfect symmetry */
  padding: var(--space-lg);
  z-index: 100;
}

/* Modal content boxes (sit upon the dark backdrop) */
#item-form-overlay > div,
#status-manager-overlay > div {
  background: var(--z4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-xl);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6);
}

/* ─── Layer 6: Interactive Elements (Topmost) ───────────────────────────────── */
input, select, button {
  background: var(--z5);
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) / 2);
  padding: var(--space-sm) var(--space-md);
  font: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

input:hover, select:hover, button:hover {
  background: #545454;
  border-color: #606060;
}

input:focus, select:focus {
  outline: 2px solid var(--text-dim);
  outline-offset: 2px;
}

button:active { transform: scale(0.98); }

/* Danger actions remain distinct but grayscale */
button.del,
#status-list button:last-child {
  background: #2a0000;
  color: #ff6666;
  border-color: #440000;
}

button.del:hover,
#status-list button:last-child:hover {
  background: #3a0000;
}

/* ─── Roadmap Specifics ─────────────────────────────────────────────────────── */
#proj-content > div > div {  /* lanes */
  border-bottom: 1px solid var(--border);
  padding: var(--space-md) 0;
}

#proj-content > div > div > div:last-child { /* lane body container */
  background: var(--z2);
  border-radius: var(--radius);
  margin-top: var(--space-sm);
}

/* ─── Responsive Flexibility ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  #home-frame,
  #proj-content {
    padding: var(--space-md);
  }

  #proj-header {
    flex-direction: column;
    align-items: stretch;
  }

  #view-switcher {
    order: 1;
    width: 100%;
  }

  #home-frame > div {
    grid-template-columns: 1fr;
  }

  #status-list > div {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  table { font-size: 0.875rem; }
  th, td { padding: var(--space-xs); }
}
