:root{
  --bg:#f5f6f8; --card:#ffffff; --border:#e3e6eb;
  --text:#1a1d24; --text-dim:#6b7280;
  --accent:#4f7cff; --accent-hover:#3d68f0; --accent-soft:#eaf0ff;
  --error:#dc2626; --error-soft:#fdecec;
  --sidebar-bg:#ffffff;
}
*{box-sizing:border-box;}
body{
  margin:0; min-height:100vh; display:flex; align-items:center; justify-content:center;
  background:var(--bg); color:var(--text);
  font-family:ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
  padding:24px;
}
.card{
  width:100%; max-width:360px; background:var(--card); border:1px solid var(--border);
  border-radius:14px; padding:36px 32px; box-shadow:0 20px 50px -20px rgba(20,24,32,.12);
}
h1{ margin:0 0 22px; font-size:1.3rem; font-weight:700; text-align:center; }
.muted{ color:var(--text-dim); text-align:center; margin:0 0 22px; font-size:.92rem; }
.error{
  background:var(--error-soft); color:var(--error); border-radius:8px;
  padding:10px 12px; font-size:.86rem; margin:0 0 18px; text-align:center;
}
form{ display:flex; flex-direction:column; gap:6px; }
label{ font-size:.8rem; color:var(--text-dim); margin-top:12px; }
input{
  background:#fff; border:1px solid var(--border); border-radius:8px;
  color:var(--text); padding:11px 12px; font-size:.94rem; font-family:inherit;
}
input:focus{ outline:none; border-color:var(--accent); }
button{
  margin-top:22px; background:var(--accent); color:#fff; border:none; border-radius:8px;
  padding:12px; font-size:.95rem; font-weight:600; cursor:pointer; font-family:inherit;
}
button:hover{ background:var(--accent-hover); }
.logout{
  display:block; text-align:center; margin-top:8px; color:var(--text-dim);
  font-size:.86rem; text-decoration:none;
}
.logout:hover{ color:var(--text); }

/* ---------------- app shell (fixed sidebar + scrolling content) ---------------- */
body.app{
  display:block; padding:0; align-items:initial; justify-content:initial;
}
.app-shell{ display:flex; min-height:100vh; }

.sidebar{
  position:fixed; top:0; left:0; width:220px; height:100vh; overflow-y:auto;
  flex:none; background:var(--sidebar-bg); border-right:1px solid var(--border);
  display:flex; flex-direction:column; padding:22px 16px;
}
.sidebar-brand{
  font-weight:700; font-size:1.05rem; padding:0 10px 20px; margin-bottom:14px;
  border-bottom:1px solid var(--border);
}
.sidebar nav{ display:flex; flex-direction:column; gap:2px; flex:1; }
.nav-item{
  display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:8px;
  color:var(--text-dim); text-decoration:none; font-size:.9rem; font-weight:500;
}
.nav-item svg{ width:17px; height:17px; flex:none; }
.nav-item:hover{ background:var(--accent-soft); color:var(--accent); }
.nav-item.is-active{ background:var(--accent); color:#fff; }
.sidebar .logout{ margin:14px 4px 0; text-align:left; }

.content{
  margin-left:220px; width:calc(100% - 220px); height:100vh; overflow-y:auto;
  padding:40px 44px 60px;
}
.content h1{ text-align:left; margin:0 0 6px; font-size:1.6rem; }
.content .muted{ text-align:left; margin:0 0 30px; }

.project-grid{
  display:grid; grid-template-columns:repeat(auto-fill,minmax(250px,1fr)); gap:14px;
}
.project-card{
  display:flex; flex-direction:column; gap:10px; background:var(--card);
  border:1px solid var(--border); border-radius:12px; padding:18px 20px;
  transition:border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.project-card:hover{
  border-color:var(--accent); transform:translateY(-2px);
  box-shadow:0 12px 24px -14px rgba(79,124,255,.35);
}
.project-card-top{ display:flex; align-items:center; gap:12px; }
.project-icon{
  flex:none; width:38px; height:38px; border-radius:10px; background:var(--accent-soft);
  color:var(--accent); display:flex; align-items:center; justify-content:center;
  transition:transform .25s cubic-bezier(.34,1.56,.64,1), background .15s ease;
}
.project-icon svg{ width:19px; height:19px; }
.project-card:hover .project-icon{ transform:scale(1.15) rotate(-6deg); background:var(--accent); color:#fff; }
.project-card-text{ display:flex; flex-direction:column; gap:2px; min-width:0; }
.project-card .domain{
  color:var(--text); font-weight:600; font-size:.92rem;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.project-card .desc{ color:var(--text-dim); font-size:.8rem; }
.visit-btn{
  margin-top:2px; display:inline-flex; align-items:center; justify-content:center; gap:7px;
  background:var(--accent-soft); color:var(--accent); border:none; border-radius:8px;
  padding:9px 12px; font-size:.82rem; font-weight:600; text-decoration:none;
  transition:background .15s ease, color .15s ease;
}
.visit-btn svg{ width:14px; height:14px; transition:transform .15s ease; }
.visit-btn:hover{ background:var(--accent); color:#fff; }
.visit-btn:hover svg{ transform:translate(2px,-2px); }

.project-group{ margin-bottom:28px; }
.project-group h2{
  font-size:.72rem; font-weight:700; letter-spacing:.08em; text-transform:uppercase;
  color:var(--text-dim); margin:0 0 12px;
}

@media (max-width:760px){
  .app-shell{ flex-direction:column; }
  .sidebar{ position:fixed; width:100%; height:auto; flex-direction:row; align-items:center; padding:14px 16px; border-right:none; border-bottom:1px solid var(--border); }
  .sidebar-brand{ padding:0 14px 0 0; margin:0 14px 0 0; border-bottom:none; border-right:1px solid var(--border); }
  .sidebar nav{ flex-direction:row; }
  .sidebar .logout{ margin:0 0 0 auto; }
  .content{ margin-left:0; width:100%; height:auto; margin-top:60px; padding:24px 20px; }
}
