/* Dashboard responsive shell.
   Mobile-first breakpoint at 960px: below that, the sidebar slides in from the left
   and a burger button appears in the top bar. */

.gencv-dash-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.gencv-dash-sidebar {
  background: var(--paper-solid);
  border-right: 1px solid var(--line-strong);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
  z-index: 30;
}

.gencv-dash-main {
  padding: 32px 40px;
  max-width: 1200px;
  width: 100%;
  min-width: 0;
}

.gencv-dash-topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 25;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--paper-solid);
  border-bottom: 1px solid var(--line-strong);
}

.gencv-dash-burger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--bg-2);
  color: var(--ink);
  cursor: pointer;
}
.gencv-dash-burger:hover { background: var(--ink-whisper); }
.gencv-dash-burger svg { display: block; }

.gencv-dash-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--landing-vignette);
  backdrop-filter: blur(4px);
  z-index: 28;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.gencv-dash-backdrop.is-open {
  display: block;
  opacity: 1;
}

.gencv-dash-sidebar-close {
  display: none;
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* Page-level helpers used by individual dashboard views. */

.gencv-dash-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 24px;
}

.gencv-dash-h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 32px;
  letter-spacing: -0.02em;
  margin: 0;
}

/* A grid that collapses to a single column on mobile. */
.gencv-dash-grid { display: grid; gap: 14px; }
.gencv-dash-grid--2 { grid-template-columns: 1fr 1fr; }
.gencv-dash-grid--3 { grid-template-columns: repeat(3, 1fr); }
.gencv-dash-grid--2-1-1 { grid-template-columns: 2fr 1fr 1fr; }
.gencv-dash-grid--split { grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }

/* Horizontal-scroll wrapper for wide tables on small screens. */
.gencv-dash-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.gencv-dash-table-wrap table { min-width: 560px; }

@media (max-width: 960px) {
  .gencv-dash-shell {
    grid-template-columns: 1fr;
  }

  .gencv-dash-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(86vw, 320px);
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    overflow-y: auto;
    padding-top: 56px;
  }
  .gencv-dash-sidebar.is-open {
    transform: translateX(0);
    box-shadow: var(--shadow-card);
  }

  .gencv-dash-sidebar-close { display: inline-flex; }

  .gencv-dash-topbar { display: flex; }

  .gencv-dash-main {
    padding: 18px 16px 48px;
    max-width: 100%;
  }

  .gencv-dash-page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .gencv-dash-page-header > * { width: 100%; }
  .gencv-dash-page-header .gencv-btn { justify-content: center; }

  .gencv-dash-h1 { font-size: 26px; }

  .gencv-dash-grid--2,
  .gencv-dash-grid--3,
  .gencv-dash-grid--2-1-1,
  .gencv-dash-grid--split {
    grid-template-columns: 1fr;
  }

  /* Trim heavy paddings on resume preview panels for phone width. */
  .gencv-dash-paper { padding: 24px !important; }
}

/* Prevent body scroll when the off-canvas sidebar is open. */
body.gencv-dash-locked { overflow: hidden; }
