body{
font-family:Inter,Arial;
margin:0;
display:flex;
background:#f4f6fb;
}

.sidebar{
width:230px;
background:#0f172a;
color:#fff;
min-height:100vh;
padding:20px;
}

.sidebar a{
display:block;
color:#cbd5f5;
margin-top:8px;
text-decoration:none;
}

.new-btn{
display:block;
background:#6366f1;
padding:10px;
border-radius:8px;
color:#fff;
text-align:center;
margin-bottom:15px;
border:none;
cursor:pointer;
}

.main{
flex:1;
}

.topbar{
background:#fff;
padding:20px;
border-bottom:1px solid #eee;
}

.topbar input{
width:280px;
padding:8px;
}

.grid{
padding:20px;
display:grid;
grid-template-columns:repeat(auto-fill,minmax(260px,1fr));
gap:20px;
}

.card{
background:#fff;
border-radius:14px;
padding:16px;
box-shadow:0 8px 20px rgba(0,0,0,0.08);
}

.thumb{
height:150px;
overflow:hidden;
border-radius:8px;
border:1px solid #eee;
cursor:pointer;
position:relative;
z-index:1;
}

.thumb iframe{
width:600px;
height:400px;
transform:scale(0.38);
transform-origin:top left;
pointer-events:none;
}

.meta{
display:flex;
justify-content:space-between;
margin-top:6px;
}

.badge{
background:#e0e7ff;
padding:4px 8px;
border-radius:6px;
font-size:12px;
}

.fav-btn{
text-decoration:none;
font-size:18px;
}

.actions{
margin-top:10px;
display:flex;
gap:8px;
}

.actions button{
padding:6px 10px;
border:none;
border-radius:6px;
cursor:pointer;
}

.modal{
display:none;
position:fixed;
left:0;
top:0;
width:100%;
height:100%;
background:rgba(0,0,0,0.7);
z-index:9999;
}

.modal-content{
background:#fff;
width:95%;
height:90%;
margin:2% auto;
border-radius:12px;
display:flex;
flex-direction:column;
}

.modal-header{
padding:15px;
display:flex;
justify-content:space-between;
align-items:center;
border-bottom:1px solid #eee;
}

.modal-actions{
display:flex;
gap:10px;
}

.modal-actions button,
.modal-actions a{
padding:6px 12px;
border-radius:6px;
text-decoration:none;
border:none;
cursor:pointer;
background:#f1f5f9;
}

.modal-actions a.edit{
background:#6366f1;
color:#fff;
}

.modal-actions a.delete{
background:#ef4444;
color:#fff;
}

.modal-body{
flex:1;
}

.modal-body iframe{
width:100%;
height:100%;
border:none;
}

.close{
font-size:22px;
cursor:pointer;
}

.form-modal{
max-width:900px;
}

.form-grid{
display:flex;
flex-direction:column;
gap:12px;
padding:20px;
}

.code-columns{
display:grid;
grid-template-columns:1fr 1fr;
gap:20px;
}

.code-columns textarea{
height:220px;
}

.btn-primary{
background:#6366f1;
color:#fff;
padding:10px 16px;
border:none;
border-radius:8px;
cursor:pointer;
}