
:root{
  --bg:#0b0f14; --panel:#121820; --muted:#7a8aa0; --accent:#4da3ff; --ok:#1fbf75; --bad:#ff4757;
  --border: #1f2a39; --text:#e8eef6;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0; font-family:system-ui,-apple-system,Segoe UI,Roboto,Inter,Arial,sans-serif;
  background:var(--bg); color:var(--text);
}
a{color:var(--accent); text-decoration:none}
.button{
  display:inline-flex; align-items:center; gap:.5rem; padding:.75rem 1rem; border-radius:12px;
  background:linear-gradient(180deg, #1b2633, #121820); border:1px solid var(--border); color:var(--text);
  cursor:pointer; transition:transform .05s ease, box-shadow .15s ease, opacity .2s;
}
.button:hover{box-shadow:0 6px 22px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.06)}
.button:active{transform:translateY(1px)}
.button.primary{background:linear-gradient(180deg, #2a66e6, #1c49b6); border-color:#2a56c6}
.button.danger{background:linear-gradient(180deg, #772020, #4e1414); border-color:#8a2c2c}

.wrapper{max-width:1200px; margin:0 auto; padding:24px}
.header{display:flex; align-items:center; justify-content:space-between; margin-bottom:16px}
h1{margin:0; font-size:24px}

.grid-projects{
  display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:14px;
}
.project-card{
  padding:18px; border:1px solid var(--border); border-radius:16px; background:var(--panel);
  display:flex; flex-direction:column; gap:8px; min-height:120px; justify-content:space-between;
}
.project-card h3{margin:0; font-size:18px}
.badge{display:inline-flex; padding:.2rem .5rem; border-radius:999px; border:1px solid var(--border); color:var(--muted); font-size:12px}

.upload-drop{
  border:2px dashed #2a3a52; border-radius:16px; padding:24px; text-align:center; color:var(--muted);
}
.upload-drop.dragover{border-color:var(--accent); color:var(--text); background:#0e141d}

.toolbar{display:flex; gap:8px; flex-wrap:wrap; margin-bottom:10px}

.gallery-wrapper{
  position:relative; width:100%; height:calc(100vh - 180px);
  border:1px solid var(--border); border-radius:16px; background:var(--panel); padding:10px;
}
.gallery{
  display:grid; gap:8px; width:100%; height:100%;
}
.gallery img{width:100%; height:100%; object-fit:cover; border-radius:10px; display:block}
.tile{
  position:relative; border:2px solid transparent; border-radius:12px; overflow:hidden;
}
.tile.red{border-color:var(--bad)}
.tile.green{border-color:var(--ok)}
.tile .status{
  position:absolute; top:6px; left:6px; font-size:12px; background:rgba(0,0,0,.5);
  padding:.2rem .45rem; border-radius:999px;
}
.tile .actions{
  position:absolute; inset:auto 6px 6px 6px; display:flex; gap:6px; justify-content:space-between;
}
.pagination{display:flex; gap:8px; align-items:center; justify-content:flex-end; margin-top:10px}
input[type="text"], textarea{
  background:#0f141c; border:1px solid var(--border); color:var(--text); border-radius:10px; padding:.6rem .7rem; width:100%;
}
label{font-size:13px; color:var(--muted)}
.modal{
  position:fixed; inset:0; display:none; align-items:center; justify-content:center; background:rgba(0,0,0,.6);
}
.modal.open{display:flex}
.modal-card{
  width:min(560px, 96vw); background:var(--panel); border:1px solid var(--border); border-radius:16px; padding:16px;
}
.footer-note{color:var(--muted); font-size:12px; margin-top:16px}

/* --- Added: comment preview & lightbox --- */
.actions .button{opacity:.6}
.actions .button:hover{opacity:.9}

.comment-preview{
  position:absolute; left:8px; right:8px; bottom:56px;
  font-size:12px; line-height:1.3; color:#d6deea; 
  background:rgba(0,0,0,.35); padding:.35rem .5rem; border-radius:8px;
  max-height:5.2em; overflow:hidden; text-overflow:ellipsis;
  display:none;
}
.tile.has-comment .comment-preview{display:block}

.enlarge-btn{
  position:absolute; top:6px; right:6px;
  display:inline-flex; align-items:center; justify-content:center;
  width:32px; height:32px; border-radius:999px; border:1px solid var(--border);
  background:rgba(0,0,0,.35); backdrop-filter: blur(2px);
  cursor:pointer; opacity:.8;
}
.enlarge-btn:hover{opacity:1}

.modal.viewer{background:rgba(0,0,0,.75)}
.viewer-card{
  width:min(92vw, 1200px); max-height:92vh; 
  background:transparent; border:none; padding:0;
  display:flex; flex-direction:column; gap:8px;
}
.viewer-inner{
  position:relative; background:var(--panel); border:1px solid var(--border);
  border-radius:16px; padding:8px;
}
.viewer-img{
  display:block; max-width:calc(92vw - 16px); max-height:70vh; width:auto; height:auto; margin:0 auto; border-radius:12px;
}
.viewer-close{
  position:absolute; top:10px; right:10px;
  width:32px; height:32px; border-radius:999px; border:1px solid var(--border);
  background:rgba(0,0,0,.55); color:var(--text); display:flex; align-items:center; justify-content:center; cursor:pointer;
}
.viewer-comment{
  font-size:13px; color:var(--text); background:var(--panel);
  border:1px solid var(--border); border-radius:12px; padding:10px; 
}
