:root{
  --bg: #0b1220;
  --panel: rgba(255,255,255,0.06);
  --panel2: rgba(255,255,255,0.08);
  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.7);
  --border: rgba(255,255,255,0.12);
  --shadow: 0 10px 30px rgba(0,0,0,0.35);
  --accent: #7c5cff;
}

*{ box-sizing: border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: radial-gradient(1200px 600px at 20% 0%, rgba(124,92,255,0.25), transparent 50%),
              radial-gradient(800px 500px at 90% 10%, rgba(0,200,255,0.18), transparent 50%),
              var(--bg);
  color: var(--text);
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 18px 18px;
  position: sticky;
  top:0;
  backdrop-filter: blur(10px);
  background: rgba(11,18,32,0.6);
  border-bottom: 1px solid var(--border);
}

.title{
  margin:0;
  font-size: 18px;
  letter-spacing: 0.3px;
}

.actions{
  display:flex;
  gap:10px;
  flex-wrap: wrap;
}

.wrap{
  max-width: 980px;
  margin: 0 auto;
  padding: 22px 16px 40px;
}

.grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 760px){
  .grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.tile{
  background: linear-gradient(180deg, var(--panel), rgba(255,255,255,0.04));
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow:hidden;
  text-decoration:none;
  color: inherit;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  position: relative;
  min-height: 150px;
  display:flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 14px;
}

.tile:hover{
  transform: translateY(-2px);
  border-color: rgba(124,92,255,0.55);
  background: linear-gradient(180deg, var(--panel2), rgba(255,255,255,0.04));
}

.tile:active{
  transform: translateY(0px);
}

.tile img{
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.08);
}

.tile .fallback{
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display:grid;
  place-items: center;
  font-weight: 800;
  font-size: 18px;
  color: white;
  background: linear-gradient(135deg, rgba(124,92,255,0.9), rgba(0,200,255,0.7));
  border: 1px solid rgba(255,255,255,0.12);
}

.tile .label{
  margin-top: 12px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  text-align:center;
}

.tile .url{
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  text-align:center;
  word-break: break-word;
}

.tile .tools{
  position:absolute;
  top:10px;
  right:10px;
  display:flex;
  gap:8px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.tile:hover .tools{ opacity: 1; }

.tool-btn{
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.25);
  color: rgba(255,255,255,0.9);
  border-radius: 10px;
  padding: 6px 8px;
  cursor:pointer;
  font-size: 12px;
}

.btn{
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(124,92,255,0.85);
  color: white;
  border-radius: 12px;
  padding: 10px 12px;
  cursor:pointer;
  font-weight: 700;
}
.btn:hover{ filter: brightness(1.05); }

.btn-ghost{
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.92);
}

.icon-btn{
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.9);
  cursor: pointer;
  font-size: 16px;
}

.modal::backdrop{
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(3px);
}

.modal{
  border: none;
  padding: 0;
  background: transparent;
}

.modal-card{
  width: min(520px, calc(100vw - 28px));
  border-radius: 16px;
  background: rgba(18,26,44,0.9);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: var(--shadow);
  overflow:hidden;
}

.modal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 14px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.modal-head h2{
  margin: 0;
  font-size: 15px;
}

.modal-body{
  padding: 14px;
  display:grid;
  gap: 12px;
}

.field{
  display:grid;
  gap: 6px;
}

.field span{
  font-size: 12px;
  color: var(--muted);
}

.field input, .field select{
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  outline: none;
}
.field small{
  color: rgba(255,255,255,0.55);
}

.modal-foot{
  padding: 14px;
  display:flex;
  justify-content:flex-end;
  gap: 10px;
  border-top: 1px solid rgba(255,255,255,0.12);
}


/* ======================
   🔐 Login Styles
====================== */

.login-screen{
  position: fixed;
  inset: 0;
  display:flex;
  justify-content:center;
  align-items:center;
  background: radial-gradient(1200px 600px at 20% 0%, rgba(124,92,255,0.25), transparent 50%),
              radial-gradient(800px 500px at 90% 10%, rgba(0,200,255,0.18), transparent 50%),
              #0b1220;
}

.login-card{
  width: min(360px, 90%);
  background: rgba(18,26,44,0.95);
  padding: 24px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  display: grid;
  gap: 14px;
}

.login-card h2{
  margin:0 0 10px;
  text-align:center;
}

.error{
  color: #ff6b6b;
  font-size: 13px;
  text-align:center;
}