:root{
  --bg:#07121f;
  --bg-2:#0b1b2e;
  --panel:#10233a;
  --panel-2:#0d1d31;
  --text:#edf3fb;
  --soft:#9fb3c8;
  --muted:#7d93aa;
  --accent:#7ea4da;
  --accent-2:#9dc0ee;
  --line:rgba(255,255,255,0.08);
  --danger:#ff8f8f;
  --success:#9dd7a5;
  --shadow:0 18px 48px rgba(0,0,0,.28);
}

*{
  box-sizing:border-box;
}

html,
body{
  margin:0;
  padding:0;
}

body{
  font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:linear-gradient(135deg, var(--bg) 0%, var(--bg-2) 100%);
  color:var(--text);
}

.eyebrow{
  font-size:12px;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:var(--accent-2);
  margin-bottom:14px;
}

/* =========================
   LOGIN PAGE
========================= */

.lab-login-wrapper{
  min-height:100vh;
  display:flex;
}

.lab-left,
.lab-right{
  flex:1;
}

.lab-left{
  display:flex;
  align-items:center;
  justify-content:center;
  padding:48px;
}

.lab-left .content{
  width:100%;
  max-width:520px;
}

.lab-left h1{
  font-size:clamp(34px, 5vw, 58px);
  line-height:1.04;
  margin:0 0 18px;
  max-width:10ch;
}

.lab-left p{
  font-size:16px;
  line-height:1.75;
  color:var(--soft);
  max-width:560px;
  margin:0 0 28px;
}

.feature-list{
  list-style:none;
  padding:0;
  margin:0;
  display:grid;
  gap:12px;
}

.feature-list li{
  position:relative;
  padding-left:18px;
  color:var(--text);
}

.feature-list li::before{
  content:"";
  position:absolute;
  left:0;
  top:10px;
  width:7px;
  height:7px;
  border-radius:50%;
  background:var(--accent);
}

.lab-right{
  display:flex;
  align-items:center;
  justify-content:center;
  padding:32px;
}

.login-box{
  width:100%;
  max-width:380px;
  background:rgba(10, 23, 39, 0.8);
  backdrop-filter:blur(10px);
  border:1px solid var(--line);
  border-radius:20px;
  padding:28px;
  box-shadow:var(--shadow);
}

.login-header h2{
  margin:0 0 8px;
  font-size:28px;
}

.login-header p{
  margin:0 0 24px;
  color:var(--soft);
  line-height:1.6;
}

.field-label{
  display:block;
  margin:0 0 8px;
  font-size:13px;
  color:var(--soft);
}

.login-box input{
  width:100%;
  padding:14px 14px;
  margin:0 0 16px;
  background:rgba(255,255,255,0.03);
  border:1px solid var(--line);
  border-radius:12px;
  color:var(--text);
  font-size:15px;
  outline:none;
}

.login-box input:focus{
  border-color:var(--accent);
  box-shadow:0 0 0 3px rgba(126,164,218,.16);
}

.primary-btn,
.secondary-btn,
.text-btn{
  width:100%;
  border:none;
  cursor:pointer;
  transition:.2s ease;
  font-size:15px;
}

.primary-btn{
  padding:14px;
  border-radius:12px;
  background:var(--accent);
  color:#07121f;
  font-weight:700;
}

.primary-btn:hover{
  transform:translateY(-1px);
}

.secondary-btn{
  padding:14px;
  border-radius:12px;
  background:transparent;
  color:var(--text);
  border:1px solid var(--line);
}

.secondary-btn:hover{
  border-color:var(--accent);
}

.text-btn{
  margin-top:10px;
  background:none;
  color:var(--accent-2);
  padding:8px 0 0;
}

.divider{
  text-align:center;
  color:var(--muted);
  font-size:12px;
  margin:18px 0;
  position:relative;
}

.divider::before,
.divider::after{
  content:"";
  position:absolute;
  top:50%;
  width:38%;
  height:1px;
  background:var(--line);
}

.divider::before{
  left:0;
}

.divider::after{
  right:0;
}

.auth-message{
  min-height:22px;
  margin:14px 0 0;
  font-size:13px;
  line-height:1.5;
  color:var(--soft);
}

.auth-message.error{
  color:var(--danger);
}

.auth-message.success{
  color:var(--success);
}

.note{
  margin:16px 0 0;
  font-size:12px;
  line-height:1.6;
  color:var(--muted);
  text-align:center;
}

/* =========================
   HOME / APP SHELL
========================= */

.lab-home-body{
  min-height:100vh;
  background:linear-gradient(180deg, #081423 0%, #0d1c2f 100%);
}

.lab-shell{
  min-height:100vh;
  display:flex;
}

.lab-sidebar{
  width:280px;
  min-width:280px;
  background:rgba(6,16,29,0.95);
  border-right:1px solid var(--line);
  display:flex;
  flex-direction:column;
  padding:28px 18px 24px;
}

.lab-sidebar-top{
  display:flex;
  justify-content:center;
  align-items:center;
  padding-top:10px;
}

.lab-sidebar-nav{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:40px;
}

.lab-sidebar-bottom{
  margin-top:auto;
}

.lab-sidebar-note{
  margin:0;
  font-size:12px;
  line-height:1.7;
  color:var(--muted);
}

/* =========================
   CLEAN BRAND
========================= */

.lab-brand{
  display:flex;
  align-items:center;
  gap:12px;
  text-decoration:none;
  color:var(--text);
}

.lab-brand.clean{
  width:100%;
  display:flex;
  justify-content:center;
  align-items:center;
  gap:10px;
  text-decoration:none;
}

.lab-brand-logo{
  object-fit:contain;
  background:none !important;
  padding:0 !important;
  border-radius:0 !important;
}

.clean-logo{
  width:162px;
  max-width:100%;
  height:auto;
  display:block;
}

.lab-brand-text{
  display:flex;
  flex-direction:column;
  line-height:1.1;
}

.lab-brand-name{
  font-size:16px;
  font-weight:700;
  letter-spacing:.06em;
}

.lab-brand-sub{
  font-size:13px;
  color:var(--soft);
}

.lab-brand-sub.minimal{
  display:none;
  font-size:12px;
  color:var(--soft);
  letter-spacing:0.08em;
  text-transform:uppercase;
}

/* =========================
   SIDEBAR NAV
========================= */

.lab-nav-link{
  display:block;
  padding:12px 14px;
  border-radius:12px;
  color:var(--soft);
  text-decoration:none;
  transition:.2s ease;
  border:1px solid transparent;
}

.lab-nav-link:hover{
  background:rgba(255,255,255,0.03);
  color:var(--text);
  border-color:var(--line);
}

.lab-nav-link.active{
  background:rgba(126,164,218,.14);
  color:var(--text);
  border-color:rgba(126,164,218,.22);
}

/* =========================
   MAIN AREA
========================= */

.lab-main-area{
  flex:1;
  min-width:0;
}

.lab-topbar{
  border-bottom:1px solid var(--line);
  background:rgba(7,18,31,.7);
  backdrop-filter:blur(8px);
  position:sticky;
  top:0;
  z-index:10;
}

.lab-topbar-inner{
  max-width:1397px;
  margin:0 auto;
  padding:22px 32px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
}

.page-title{
  margin:0;
  font-size:28px;
}

.topbar-actions{
  display:flex;
  align-items:center;
  gap:12px;
}

.user-pill{
  border:1px solid var(--line);
  border-radius:999px;
  padding:10px 14px;
  color:var(--soft);
  font-size:14px;
}

.compact-btn{
  width:auto;
  min-width:110px;
}

.lab-home-main{
  max-width:1397px;   /* ✅ */
  margin:0 auto;
  padding:28px 32px 48px;
}

/* =========================
   CONTENT CARDS
========================= */

.home-hero-card,
.home-card{
  border:1px solid var(--line);
  background:rgba(255,255,255,0.03);
  border-radius:20px;
  box-shadow:var(--shadow);
}

.home-hero-card{
  padding:28px;
  margin-bottom:24px;
}

.home-hero-card h2{
  margin:0 0 14px;
  font-size:30px;
}

.home-hero-card p{
  margin:0;
  color:var(--soft);
  line-height:1.7;
  max-width:780px;
}

.home-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:20px;
}

.home-card{
  padding:24px;
}

.home-card h3{
  margin:0 0 12px;
  font-size:20px;
}

.home-card p{
  margin:0;
  color:var(--soft);
  line-height:1.7;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 980px){
  .lab-shell{
    flex-direction:column;
  }

  .lab-sidebar{
    width:100%;
    min-width:0;
    border-right:none;
    border-bottom:1px solid var(--line);
    padding:18px;
  }

  .lab-sidebar-top{
    justify-content:flex-start;
    padding-top:0;
  }

  .lab-brand.clean{
    justify-content:flex-start;
  }

  .clean-logo{
    width:132px;
  }

  .lab-sidebar-nav{
    flex-direction:row;
    flex-wrap:wrap;
    margin-top:24px;
  }

  .lab-sidebar-bottom{
    margin-top:18px;
  }

  .lab-nav-link{
    width:auto;
  }
}

@media (max-width: 920px){
  .lab-login-wrapper{
    flex-direction:column;
  }

  .lab-left{
    padding:40px 24px 12px;
  }

  .lab-right{
    padding:12px 24px 32px;
  }

  .home-grid{
    grid-template-columns:1fr;
  }

  .lab-topbar-inner{
    flex-direction:column;
    align-items:flex-start;
    padding:22px 24px;
  }

  .topbar-actions{
    width:100%;
    justify-content:space-between;
  }

  .lab-home-main{
    padding:24px;
  }
}

@media (max-width: 560px){
  .lab-left h1{
    max-width:none;
  }

  .login-box{
    padding:22px;
    border-radius:16px;
  }

  .home-hero-card,
  .home-card{
    padding:20px;
  }

  .page-title{
    font-size:24px;
  }

  .clean-logo{
    width:118px;
  }
}
.card-kicker{
  font-size:11px;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:var(--accent-2);
  margin-bottom:10px;
}

.metric-value{
  font-size:40px;
  font-weight:700;
  line-height:1;
  margin:6px 0 14px;
  color:var(--text);
}

.card-kicker{
  font-size:11px;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:var(--accent-2);
  margin-bottom:10px;
}

.metric-value{
  font-size:40px;
  font-weight:700;
  line-height:1;
  margin:6px 0 14px;
  color:var(--text);
}

.section-title{
  margin:0;
  font-size:32px;
}

.research-header{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:20px;
  margin-bottom:20px;
}

.research-form{
  margin-bottom:24px;
  padding:18px;
  border:1px solid var(--line);
  border-radius:18px;
  background:rgba(255,255,255,0.03);
  box-shadow:var(--shadow);
}

.research-form-grid{
  display:grid;
  grid-template-columns:2fr 1fr;
  gap:12px;
  margin-bottom:12px;
}

.research-form input,
.research-form textarea,
.research-form select{
  width:100%;
  padding:14px;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(255,255,255,0.03);
  color:var(--text);
  font-size:15px;
  outline:none;
}

.research-form textarea{
  min-height:110px;
  resize:vertical;
}

.research-form input:focus,
.research-form textarea:focus,
.research-form select:focus{
  border-color:var(--accent);
  box-shadow:0 0 0 3px rgba(126,164,218,.16);
}

.research-form-actions{
  margin-top:12px;
}

.research-list{
  display:grid;
  gap:14px;
}

.research-item{
  padding:22px 18px;
  border:1px solid var(--line);
  border-radius:18px;
  background:rgba(255,255,255,0.03);
  box-shadow:var(--shadow);
}

.research-item-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin-bottom:12px;
}

.research-item h3{
  margin:0;
  font-size:18px;
}

.research-item-summary{
  margin:0 0 14px;
  color:var(--soft);
  line-height:1.7;
}

.research-meta{
  display:flex;
  flex-wrap:wrap;
  gap:16px;
  font-size:13px;
  color:var(--muted);
}

.status-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:7px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:600;
  border:1px solid var(--line);
}

.status-draft{
  background:rgba(157,192,238,.12);
  color:var(--accent-2);
}

.status-in_review{
  background:rgba(255,201,107,.12);
  color:#ffd27a;
}

.status-published{
  background:rgba(157,215,165,.12);
  color:var(--success);
}

.empty-state{
  max-width:420px;
}

.research-loading{
  color:var(--soft);
  font-size:14px;
}

@media (max-width: 820px){
  .research-header{
    align-items:flex-start;
    flex-direction:column;
  }

  .research-form-grid{
    grid-template-columns:1fr;
  }

  .research-item-top{
    align-items:flex-start;
    flex-direction:column;
  }
}

.hidden{
  display:none !important;
}

.hidden{
  display:none !important;
}

.section-title{
  margin:0;
  font-size:32px;
}

.card-kicker{
  font-size:11px;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:var(--accent-2);
  margin-bottom:10px;
}

.metric-value{
  font-size:40px;
  font-weight:700;
  line-height:1;
  margin:6px 0 14px;
  color:var(--text);
}

.research-header{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:20px;
  margin-bottom:20px;
}

.research-form{
  margin-bottom:24px;
  padding:18px;
  border:1px solid var(--line);
  border-radius:18px;
  background:rgba(255,255,255,0.03);
  box-shadow:var(--shadow);
}

.research-form-grid{
  display:grid;
  grid-template-columns:2fr 1fr;
  gap:12px;
  margin-bottom:12px;
}

.research-form input,
.research-form textarea,
.research-form select{
  width:100%;
  padding:14px;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(255,255,255,0.03);
  color:var(--text);
  font-size:15px;
  outline:none;
}

.research-form textarea{
  min-height:110px;
  resize:vertical;
}

.research-form input:focus,
.research-form textarea:focus,
.research-form select:focus{
  border-color:var(--accent);
  box-shadow:0 0 0 3px rgba(126,164,218,.16);
}

.research-form-actions{
  margin-top:12px;
}

.research-list{
  display:grid;
  gap:14px;
}

.research-item{
  padding:22px 18px;
  border:1px solid var(--line);
  border-radius:18px;
  background:rgba(255,255,255,0.03);
  box-shadow:var(--shadow);
}

.research-item-clickable{
  cursor:pointer;
}

.research-item-clickable:hover{
  border-color:rgba(126,164,218,.28);
  transform:translateY(-1px);
}

.research-item-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin-bottom:12px;
}

.research-item h3{
  margin:0;
  font-size:18px;
}

.research-item-summary{
  margin:0 0 14px;
  color:var(--soft);
  line-height:1.7;
}

.research-meta,
.detail-meta{
  display:flex;
  flex-wrap:wrap;
  gap:16px;
  font-size:13px;
  color:var(--muted);
}

.status-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:7px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:600;
  border:1px solid var(--line);
}

.status-draft{
  background:rgba(157,192,238,.12);
  color:var(--accent-2);
}

.status-in_review{
  background:rgba(255,201,107,.12);
  color:#ffd27a;
}

.status-published{
  background:rgba(157,215,165,.12);
  color:var(--success);
}

.empty-state{
  max-width:420px;
}

.research-loading{
  color:var(--soft);
  font-size:14px;
}

.detail-header{
  margin-bottom:20px;
}

.detail-back-btn{
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

.detail-card{
  border:1px solid var(--line);
  border-radius:20px;
  background:rgba(255,255,255,0.03);
  box-shadow:var(--shadow);
}

.detail-card-body{
  padding:26px;
}

.detail-card-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:20px;
  margin-bottom:18px;
}

.detail-title{
  margin:0;
  font-size:32px;
}

.detail-section{
  margin-top:24px;
}

.detail-section h3{
  margin:0 0 10px;
  font-size:18px;
}

.detail-section p{
  margin:0;
  color:var(--soft);
  line-height:1.8;
}

@media (max-width: 820px){
  .research-header{
    align-items:flex-start;
    flex-direction:column;
  }

  .research-form-grid{
    grid-template-columns:1fr;
  }

  .research-item-top,
  .detail-card-top{
    align-items:flex-start;
    flex-direction:column;
  }
}
