/* LabMeet Editorial Layout System */
.lm-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.lm-header {
  height: 64px;
  display: flex;
  align-items: center;
  background: rgba(247, 248, 245, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--lm-border);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: all 0.3s ease-in-out;
}

.lm-header.is-scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.lm-header-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* Brand & Logo */
.lm-brand-img {
  display: block;
  height: 30px;
  width: auto;
  max-width: 145px;
  object-fit: contain;
  transition: opacity 0.3s ease-in-out, transform 0.2s ease;
}

.lm-brand-img-dark {
  display: none !important;
}

.lm-brand-img-light {
  display: block !important;
}

.lm-brand:hover .lm-brand-img {
  transform: translateY(-1px);
}

.lm-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--lm-ink);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.6px;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.3s ease-in-out;
}

.lm-brand:hover {
  text-decoration: none;
  color: var(--lm-primary-strong);
}

.lm-brand-mark {
  background: var(--lm-primary);
  color: #ffffff;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  border-radius: 10px;
  flex-shrink: 0;
  transition: all 0.3s ease-in-out;
}

.lm-nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.lm-nav a {
  color: var(--lm-muted);
  font-weight: 600;
  font-size: 14.5px;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  transition: all 0.3s ease-in-out;
}

.lm-nav a:hover {
  color: var(--lm-ink);
  background: rgba(0, 0, 0, 0.05);
  text-decoration: none;
}

.lm-nav a[aria-current] {
  color: var(--lm-primary-strong);
  font-weight: 700;
  background: rgba(79, 70, 245, 0.08);
}

.lm-account {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
  white-space: nowrap;
  flex-shrink: 0;
}

.lm-header-user-name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--lm-ink);
  margin-right: 6px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  line-height: 1;
  transition: all 0.3s ease-in-out;
}

.lm-icon-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  padding: 0 !important;
  border-radius: 12px !important;
  font-size: 17px !important;
  line-height: 1 !important;
  background: #ffffff !important;
  border: 1px solid var(--lm-border, #e2e8f0) !important;
  color: var(--lm-ink, #1e293b) !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
  transition: all 0.3s ease-in-out !important;
  text-decoration: none !important;
  cursor: pointer;
  position: relative;
}

.lm-icon-btn i {
  font-size: 19px !important;
  line-height: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: var(--lm-ink, #1e293b);
  transition: color 0.15s ease;
  margin: 0 !important;
}

.lm-icon-btn i::before {
  vertical-align: 0 !important;
  line-height: 1 !important;
}

.lm-icon-btn svg {
  display: block;
  flex-shrink: 0;
  color: var(--lm-ink, #1e293b);
  transition: color 0.15s ease;
  margin: 0 auto;
}

.lm-icon-btn:hover {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  transform: translateY(-1px);
}

.lm-icon-btn:hover i,
.lm-icon-btn:hover svg {
  color: var(--lm-primary-strong, #4F46E5);
}

.lm-icon-btn.active,
.lm-icon-btn.btn-primary {
  background: var(--lm-primary, #3157D5) !important;
  border-color: var(--lm-primary, #3157D5) !important;
}

.lm-icon-btn.active i,
.lm-icon-btn.btn-primary i {
  color: #ffffff !important;
}

.lm-account .btn {
  height: 38px;
  min-height: 38px;
  font-size: 13.5px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.lm-demo-banner {
  background: #f8fafc;
  border-bottom: 1px solid var(--lm-border-light, #e2e8f0);
  color: var(--lm-text-muted, #64748b);
  font-size: 12.5px;
  font-weight: 500;
  padding: 7px 0;
  letter-spacing: -0.01em;
}

.lm-demo-banner .lm-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lm-demo-banner i {
  color: var(--lm-primary, #3157D5);
  font-size: 13.5px;
}

.lm-main {
  min-height: 70vh;
  padding-top: 36px;
  padding-bottom: 64px;
}

/* Footer */
.lm-footer {
  border-top: 1px solid var(--lm-border);
  padding: 48px 0 32px;
  background: #ffffff;
  color: var(--lm-muted);
}

.lm-footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 36px;
}

.lm-footer-desc {
  font-size: 14px;
  color: var(--lm-muted);
  line-height: 1.6;
  margin-bottom: 16px;
}

.lm-footer-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--lm-page);
  border: 1px solid var(--lm-border);
  color: var(--lm-muted);
}

.lm-footer-heading {
  font-size: 13px;
  font-weight: 700;
  color: var(--lm-ink);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}

.lm-footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
}

.lm-footer-links a {
  color: var(--lm-muted);
  text-decoration: none;
}

.lm-footer-links a:hover {
  color: var(--lm-primary-strong);
  text-decoration: underline;
}

.lm-footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--lm-border);
}

/* Workspace */
.lm-workspace {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

.lm-sidebar {
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: 88px;
}

.lm-sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lm-sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-control);
  color: var(--lm-muted);
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
}

.lm-sidebar a:hover {
  background: #f1f4f9;
  color: var(--lm-ink);
  text-decoration: none;
}

.lm-sidebar a[aria-current],
.lm-sidebar a.active {
  background: var(--lm-lavender);
  color: var(--lm-primary-strong);
  font-weight: 700;
}

.lm-workspace-content {
  flex: 1;
  min-width: 0;
}

/* Page Header */
.lm-page-header {
  margin-bottom: 28px;
}

.lm-page-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.lm-page-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--lm-ink);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.lm-page-desc {
  font-size: 15px;
  color: var(--lm-muted);
  margin-bottom: 0;
}

.lm-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--lm-muted);
  margin-bottom: 16px;
  text-decoration: none;
}

.lm-back-link:hover {
  color: var(--lm-primary-strong);
  text-decoration: underline;
}

/* KPI Bento Grid */
.lm-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.lm-kpis > div,
.lm-kpi-card {
  background: var(--lm-surface);
  border: 1px solid var(--lm-border);
  border-radius: var(--radius-card);
  padding: 20px 22px;
  box-shadow: var(--shadow-card);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  overflow: hidden;
}

.lm-kpis > div:hover,
.lm-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(23, 25, 35, 0.08);
}

.lm-kpi-card.kpi-lavender,
.lm-kpis > div:nth-child(1) {
  border-left: 4px solid var(--lm-primary-strong);
}

.lm-kpi-card.kpi-coral,
.lm-kpis > div:nth-child(2) {
  border-left: 4px solid #FF8F75;
}

.lm-kpi-card.kpi-mint,
.lm-kpis > div:nth-child(3) {
  border-left: 4px solid #10B981;
}

.lm-kpi-card.kpi-sky,
.lm-kpis > div:nth-child(4) {
  border-left: 4px solid #38BDF8;
}

.lm-kpi-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--lm-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.lm-kpi-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--lm-ink);
  letter-spacing: -0.02em;
}

.lm-status-region:empty {
  display: none;
}

@media (max-width: 991px) {
  .lm-sidebar {
    display: none;
  }
  .lm-workspace {
    display: block;
  }
  .lm-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .lm-nav {
    gap: 8px;
  }
  .lm-header-inner {
    gap: 16px;
  }
  .lm-footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

@media (max-width: 575px) {
  .lm-container {
    padding: 0 16px;
  }
  .lm-header {
    height: 58px;
  }
.lm-brand {
    font-size: 19px;
  }
  .lm-brand-mark {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }
  .lm-nav {
    gap: 6px;
    font-size: 13.5px;
  }
  .lm-account {
    gap: 4px;
  }
  .lm-main {
    padding-top: 20px;
    padding-bottom: 40px;
  }
  .lm-page-title {
    font-size: 24px;
  }
  .lm-page-header-row {
    flex-direction: column;
    align-items: stretch;
  }
  .lm-kpis {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .lm-account .btn {
    padding: 6px 10px;
    font-size: 12.5px;
  }
  .lm-account select,
  .lm-account .lm-role-select {
    width: 96px;
    min-width: 96px;
    font-size: 12.5px;
    padding: 4px 20px 4px 8px;
  }
}

/* Q8: authenticated header exceeded 360px. Keep its controls in a local grid. */
@media (max-width:575px){
  .lm-header{height:auto;padding-block:8px}
  .lm-header-inner{display:grid;grid-template-columns:auto minmax(0,1fr);gap:8px 12px}
  .lm-header-inner .lm-brand{grid-column:1;grid-row:1}
  .lm-header-inner .lm-account{grid-column:2;grid-row:1;min-width:0;max-width:100%;flex-wrap:wrap;justify-content:flex-end}
  .lm-header-inner .lm-nav{grid-column:1 / -1;grid-row:2;min-width:0;max-width:100%;overflow-x:auto}
  .lm-header-inner .lm-nav a{white-space:nowrap;flex-shrink:0}
}
