/* Lua Vault Server — Apple-ish UI */

:root{
  --bg1: #0b1220;
  --bg2: #0b2a4d;
  --stroke: rgba(255,255,255,.14);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.68);
  --muted2: rgba(255,255,255,.52);
  --shadow: 0 18px 60px rgba(0,0,0,.35);
  --shadow2: 0 10px 35px rgba(0,0,0,.25);
  --radius2: 24px;
  --danger: #fb7185;
  --ok: #34d399;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

*{ box-sizing: border-box; }
html { 
  height: 100%;
  background: radial-gradient(1200px 600px at 20% 10%, rgba(103,232,249,.18), transparent 60%),
              radial-gradient(900px 500px at 80% 20%, rgba(167,139,250,.16), transparent 55%),
              radial-gradient(1200px 800px at 40% 90%, rgba(52,211,153,.12), transparent 60%),
              linear-gradient(180deg, var(--bg1), var(--bg2));
  background-attachment: fixed;
}
body{
  margin:0;
  font-family: var(--font);
  color: var(--text);
  overflow-x: hidden;
  min-height: 100%;
}

.bg{
  position: fixed; inset:0; z-index: 1;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='360' viewBox='0 0 360 360'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.06'%3E%3Cpath d='M0 40H360M0 120H360M0 200H360M0 280H360'/%3E%3Cpath d='M40 0V360M120 0V360M200 0V360M280 0V360'/%3E%3C/g%3E%3C/svg%3E") center/360px;
  pointer-events:none;
  opacity: .8;
}

a{ color: inherit; }
main { position: relative; z-index: 2; }
.container{ width: min(1200px, calc(100% - 24px)); margin: 18px auto 90px; }

.topbar{
  position: sticky; top:0; z-index: 20;
  display:flex; align-items:center; justify-content: space-between; gap: 18px;
  padding: 18px 22px;
  margin: 14px auto 0;
  width: min(1200px, calc(100% - 24px));
  border-radius: var(--radius2);
  background: rgba(255,255,255,.07);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow2);
  backdrop-filter: blur(16px);
}

.brand{ display:flex; align-items:center; gap: 12px; min-width: 260px; }
.logo{
  width: 44px; height: 44px; border-radius: 14px;
  display:grid; place-items:center;
  background: rgba(255,255,255,.1);
  border:1px solid rgba(255,255,255,.16);
  box-shadow: 0 8px 30px rgba(0,0,0,.25);
  font-size: 20px;
}
.title{ font-weight: 720; letter-spacing: .2px; }
.subtitle{ color: var(--muted2); font-size: 12.5px; margin-top: 2px; }

.actions{ display:flex; align-items:center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

.panel{
  background: rgba(255,255,255,.06);
  border: 1px solid var(--stroke);
  border-radius: var(--radius2);
  box-shadow: var(--shadow2);
  backdrop-filter: blur(16px);
  padding: 16px;
}

.panelRow{ display:flex; align-items:flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.searchWrap{ flex: 1 1 420px; min-width: 280px; }
.hint{ margin-top: 8px; font-size: 12px; color: var(--muted2); }
.filters{ display:flex; gap: 10px; flex: 0 0 auto; flex-wrap: wrap; align-items: center; }

.stats{
  margin-top: 14px; display:flex; gap: 10px; flex-wrap: wrap;
  color: var(--muted); font-size: 13px;
}
.pill{
  display:inline-flex; align-items:center; gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
}

.grid{
  margin-top: 14px;
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
}

.card{
  grid-column: span 4;
  min-height: 138px;
  border-radius: var(--radius2);
  background: rgba(255,255,255,.06);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow2);
  backdrop-filter: blur(16px);
  padding: 14px;
  display:flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
  text-decoration: none;
}
.card:hover{
  transform: translateY(-2px);
  background: rgba(255,255,255,.085);
  border-color: rgba(255,255,255,.2);
}
@media (max-width: 980px){ .card{ grid-column: span 6; } }
@media (max-width: 640px){ .card{ grid-column: span 12; } }

.cardTop{ display:flex; align-items:flex-start; justify-content: space-between; gap: 12px; }
.cardTitle{ font-weight: 720; letter-spacing: .2px; font-size: 16px; line-height: 1.2; }
.cardMeta{ color: var(--muted2); font-size: 12.5px; margin-top: 6px; }
.badge{
  display:inline-flex; align-items:center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.82);
  font-size: 12px;
  white-space: nowrap;
}
.tags{ display:flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag{
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(103,232,249,.10);
  border: 1px solid rgba(103,232,249,.22);
  color: rgba(255,255,255,.86);
  font-size: 12px;
}

.cardBottom{ display:flex; align-items:center; justify-content: space-between; margin-top: 14px; }
.chip{
  display:inline-flex; align-items:center; gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(167,139,250,.10);
  border: 1px solid rgba(167,139,250,.22);
  color: rgba(255,255,255,.86);
  font-size: 12px;
}
.smallMuted{ color: var(--muted2); font-size: 12px; }

/* Inputs */
.input, .select, .textarea, .codearea{
  width: 100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.18);
  color: var(--text);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.select{ padding: 12px 12px; }
.textarea{ resize: vertical; }
.codearea{
  resize: vertical;
  font-family: var(--mono);
  line-height: 1.4;
  tab-size: 2;
  min-height: 320px;
}
.input::placeholder, .textarea::placeholder, .codearea::placeholder{ color: rgba(255,255,255,.38); }
.input:focus, .select:focus, .textarea:focus, .codearea:focus{
  border-color: rgba(103,232,249,.45);
  box-shadow: 0 0 0 4px rgba(103,232,249,.10);
}

.btn{
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0,0,0,.20);
  transition: transform .14s ease, background .14s ease, border-color .14s ease;
  font-weight: 650;
  letter-spacing: .2px;
  text-decoration: none;
  display:inline-flex;
  align-items:center;
  gap: 8px;
}
.btn:hover{ transform: translateY(-1px); background: rgba(255,255,255,.085); border-color: rgba(255,255,255,.22); }
.btn.primary{
  background: linear-gradient(135deg, rgba(103,232,249,.22), rgba(167,139,250,.18));
  border-color: rgba(103,232,249,.25);
}
.btn.danger{ background: rgba(251,113,133,.14); border-color: rgba(251,113,133,.26); }
.btn.ok{ background: rgba(52,211,153,.14); border-color: rgba(52,211,153,.26); }

.notice{
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.85);
  font-size: 13px;
}
.notice.ok{ border-color: rgba(52,211,153,.25); background: rgba(52,211,153,.10); }
.notice.bad{ border-color: rgba(251,113,133,.25); background: rgba(251,113,133,.10); }

.kbd{
  font-family: var(--mono);
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.18);
  color: rgba(255,255,255,.82);
}

.footer{
  position: fixed; bottom: 10px; left: 0; right: 0; z-index: 20;
  width: min(1200px, calc(100% - 24px));
  margin: 0 auto;
  display:flex; align-items:center; justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius2);
  background: rgba(255,255,255,.06);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow2);
  backdrop-filter: blur(16px);
  color: var(--muted2);
  font-size: 12.5px;
}

.split{
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 12px;
}
@media (max-width: 980px){ .split{ grid-template-columns: 1fr; } }

.codeBlock{
  white-space: pre-wrap;          /* wrap long lines */
  word-break: break-word;
  overflow-wrap: anywhere;

  overflow:auto;
  font-family: var(--mono);
  line-height: 1.45;
  background: rgba(0,0,0,.22);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 18px;
  padding: 12px;
  min-height: 260px;
}

.table{
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.04);
}
.table th, .table td{
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,.10);
  font-size: 13px;
  color: rgba(255,255,255,.86);
}
.table th{
  text-align: left;
  color: rgba(255,255,255,.70);
  font-weight: 700;
  background: rgba(255,255,255,.05);
}
.table tr:last-child td{ border-bottom: none; }
