/* ─── Blueprint Hub — Custom Styles ──────────────────────── */

:root {
  --bp-sidebar-w: 220px;
  --bp-primary: #2563eb;
  --bp-surface: #f8fafc;
  --bp-border: #e2e8f0;
  --bp-text: #0f172a;
  --bp-muted: #64748b;
}

/* Layout */
body.bp-body {
  margin: 0;
  display: grid;
  grid-template-columns: var(--bp-sidebar-w) 1fr;
  grid-template-rows: 100vh;
  background: var(--bp-surface);
  color: var(--bp-text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Sidebar */
.bp-sidebar {
  background: #0f172a;
  color: #cbd5e1;
  padding: 0;
  overflow-y: auto;
  position: sticky;
  top: 0;
  height: 100vh;
}

.bp-sidebar-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: 1.25rem 1rem;
  font-weight: 700;
  font-size: 1rem;
  color: #f1f5f9;
  border-bottom: 1px solid rgba(255,255,255,.07);
  letter-spacing: -.01em;
}

.bp-sidebar-brand i {
  font-size: 1.3rem;
  color: var(--bp-primary);
}

.bp-sidebar .nav-link {
  color: #94a3b8;
  padding: .45rem 1rem;
  border-radius: 6px;
  margin: 0 .5rem;
  font-size: .875rem;
  transition: background .15s, color .15s;
}

.bp-sidebar .nav-link:hover,
.bp-sidebar .nav-link.active {
  background: rgba(37,99,235,.18);
  color: #e0eaff;
}

.bp-sidebar-user {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .75rem 1rem;
  border-top: 1px solid rgba(255,255,255,.07);
  font-size: .8rem;
  color: #94a3b8;
  margin-top: auto;
}

/* Main area */
.bp-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.bp-topbar {
  background: #fff;
  border-bottom: 1px solid var(--bp-border);
  padding: .65rem 1.5rem;
  font-size: .875rem;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.bp-content {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

/* Login */
body.bp-login-body {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bp-login-wrap {
  width: 100%;
  max-width: 400px;
  padding: 1rem;
}

.bp-login-card {
  background: #fff;
  border-radius: 12px;
  padding: 2.5rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

.bp-login-brand {
  display: flex;
  align-items: center;
  color: var(--bp-primary);
  margin-bottom: .5rem;
}

/* Project cards */
.bp-project-card {
  border: 1px solid var(--bp-border);
  border-radius: 10px;
  transition: box-shadow .15s, border-color .15s;
}

.bp-project-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,.07);
  border-color: #bfdbfe;
}

/* Detail layout */
.bp-detail-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.25rem;
  align-items: start;
}

/* Pages panel */
.bp-pages-panel {
  background: #fff;
  border: 1px solid var(--bp-border);
  border-radius: 10px;
  padding: 1rem;
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.bp-pages-list {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.bp-page-thumb {
  border: 1px solid var(--bp-border);
  border-radius: 8px;
  overflow: hidden;
  background: #f8fafc;
  transition: border-color .15s;
}

.bp-page-thumb:hover {
  border-color: var(--bp-primary);
}

.bp-page-img-wrap {
  display: block;
  overflow: hidden;
  background: #e2e8f0;
  height: 140px;
}

.bp-page-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .2s;
}

.bp-page-img:hover {
  transform: scale(1.03);
}

.bp-page-footer {
  display: flex;
  align-items: center;
  padding: .35rem .5rem;
  gap: .25rem;
}

/* Items panel */
.bp-items-panel {
  background: #fff;
  border: 1px solid var(--bp-border);
  border-radius: 10px;
  padding: 1rem;
}

.bp-items-table th {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--bp-muted);
  font-weight: 600;
}

.bp-items-table td {
  vertical-align: middle;
}

/* Upload dropzone */
.bp-dropzone {
  border: 2px dashed var(--bp-border);
  border-radius: 12px;
  padding: 2.5rem;
  text-align: center;
  transition: border-color .2s, background .2s;
  cursor: pointer;
  position: relative;
}

.bp-dropzone--over {
  border-color: var(--bp-primary);
  background: #eff6ff;
}

.bp-file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

/* Empty state */
.bp-empty-state {
  max-width: 380px;
  margin: 0 auto;
}

/* Responsive */
@media (max-width: 900px) {
  body.bp-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .bp-sidebar {
    height: auto;
    position: relative;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .bp-detail-grid {
    grid-template-columns: 1fr;
  }
  .bp-pages-panel {
    position: relative;
    max-height: 300px;
  }
}
