:root { --bg:#f4f8f6; --fg:#111; --muted:#6b7280; --brand:#22c55e; --card:#fff; --line:#e5e7eb; }
* { box-sizing: border-box; }
body { margin:0; font:14px/1.5 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu; color:var(--fg); background:var(--bg); }
a { color:#0ea5e9; text-decoration:none; }
.container { max-width: 960px; margin: 0 auto; padding: 20px; }
.topbar { display:flex; justify-content:space-between; align-items:center; margin-bottom: 10px; }
h1 { margin:10px 0 20px; }
section { background:var(--card); border:1px solid var(--line); border-radius:12px; padding:16px; margin:16px 0; }
.auth { max-width:420px; margin-top:60px; }
.footer-main { margin:2rem 0 1rem 0; text-align:center; }

label { display:block; margin:8px 0 4px; }
input[type=text], input[type=password], input[type=file] {
  width:100%; padding:10px; border:1px solid var(--line); border-radius:8px; background:#fff;
}
button { background:var(--brand); color:#fff; border:none; padding:10px 14px; border-radius:8px; cursor:pointer; }
button:hover { filter:brightness(0.95); }
.error { background:#fee2e2; color:#991b1b; border:1px solid #fecaca; padding:10px; border-radius:8px; margin:10px 0; white-space:pre-line;}
.msg { background:#dcfce7; color:#14532d; border:1px solid #bbf7d0; padding:10px; border-radius:8px; margin:10px 0;}
.hint { color:var(--muted); font-size:12px; margin-top:6px; }
.gallery .grid { display:grid; grid-template-columns: repeat(auto-fill,minmax(220px,1fr)); gap:12px; }
.card { background:#fff; border:1px solid var(--line); border-radius:10px; padding:8px; }
.card img { width:100%; height:220px; object-fit:cover; border-radius:8px; display:block; }
.card figcaption { font-size:12px; color:var(--muted); margin-top:6px; }
.chat-box { border:1px solid var(--line); border-radius:8px; background:#f8fafc; height:220px; overflow:auto; padding:8px; }
.chat-msg { padding:4px 0; }
.chat-form{ display:flex; gap:8px; margin-top:8px; }
.chat-form input{ flex:1; }

.tbl{width:100%; border-collapse:collapse; }
.tbl th, .tbl td{ border:1px solid var(--line); padding:8px; font-size:13px; vertical-align:top; }
.tbl th{ background:#f3f4f6; text-align:left; }
.actions{ display:flex; flex-wrap:wrap; gap:8px; }
.actions--spread{ justify-content:space-between; }
.inline{ display:inline-block; margin:0; }
.btn{
  display:inline-flex;
  align-items:center;
  padding:8px 12px;
  border: none;
  border-radius:8px;
  background:var(--brand);
  color:#fff;
  text-decoration:none;
  font:inherit;
  line-height:1;
  cursor:pointer;
}
.btn:hover{ filter:brightness(0.95); }
.btn-warn{ background:#f59e0b; }
.btn-danger{ background:#ef4444; }
.badge{ display:inline-block; padding:2px 8px; border-radius:999px; font-size:12px; border:1px solid var(--line); background:#fff; }
.badge-admin{ background:#dbeafe; border-color:#bfdbfe; }
.badge-user{ background:#f1f5f9; }
.badge-ok{ background:#dcfce7; border-color:#bbf7d0; }
.badge-off{ background:#fee2e2; border-color:#fecaca; }
.thumb90{ width:90px; height:90px; object-fit:cover; border-radius:6px; }

.btn-ghost{
  display:inline-flex;
  align-items:center;
  padding:8px 12px;
  border: none;
  border-radius:8px;
  background:transparent;
  color:var(--fg);
  text-decoration:none;
  font:inherit;
  line-height:1;
  cursor:pointer;
}
.btn-ghost:hover{ filter:none; opacity:.9; }

.admin-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

@media (max-width: 640px) {
  .container { padding: 12px; }
  .topbar { flex-direction: column; gap: 8px; align-items: stretch; }
  .auth { max-width: 100%; margin-top: 20px; }

  .gallery .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .card img { height: 160px; }

  .chat-box { height: 40vh; }
  .chat-form{ flex-direction:column; }
  .chat-form .btn{ width:100%; }
}

@supports (padding: max(0px)) {
  .container {
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
  }
}

@supports (aspect-ratio: 4 / 3) {
  .card img { height: auto; aspect-ratio: 4 / 3; }
  .thumb90  { height: auto; aspect-ratio: 1 / 1; }
}

:root[data-theme="dark"] {
  --bg:#0b0f10; --fg:#d5753c; --muted:#9ca3af; --brand:#22c55e;
  --card:#0f172a; --line:#1f2937;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg:#0b0f10; --fg:#d5753c; --muted:#9ca3af; --brand:#22c55e;
    --card:#0f172a; --line:#1f2937;
  }
}

input[type=text], input[type=password], input[type=file] {
  background: var(--card); color: var(--fg); border-color: var(--line);
}
.card { background: var(--card); border-color: var(--line); }
.chat-box { background: #0f172a; border-color: var(--line); }
.badge { background: var(--card); border-color: var(--line); }


.no-scroll { overflow: hidden; }
.lightbox.hidden { display: none; }
.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; place-items: center;
}
.lightbox__backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,.75);
  backdrop-filter: blur(2px);
}
.lightbox__content {
  position: relative; max-width: 95vw; max-height: 90vh;
  background: var(--card); border:1px solid var(--line);
  border-radius: 12px; padding: 8px 44px; display: grid; gap: 8px;
}
.lightbox__img {
  max-width: 90vw; max-height: 75vh; width: auto; height: auto; display:block; border-radius: 8px;
}
.lightbox__meta { font-size: 13px; color: var(--muted); }
.lightbox__title { color: var(--fg); font-weight: 600; }
.lightbox__close {
  position: absolute; top: 6px; right: 8px;
  width: 32px; height: 32px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--fg); cursor: pointer;
}
.lightbox__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--fg); cursor: pointer;
}
.lightbox__prev { left: 6px; }
.lightbox__next { right: 6px; }

@media (max-width:640px){
  .lightbox__content { padding: 8px 40px; }
  .lightbox__img { max-width: 94vw; max-height: 70vh; }
}

.report-link { font-size:12px; color:#ef4444; }
.report-link:hover { text-decoration: underline; }

.badge-alert{ background:#fee2e2; border-color:#fecaca; color:#991b1b; }

.visibility--private { color: #6b7280; }
.caption { font-size: 12px; color: #6b7280; }


.chat-time { color: #9ca3af; font-size: 12px; margin-right: 8px; }
.chat-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 440px;
  margin: 0 auto;
}
.chat-form input,
.chat-form select,
.chat-form textarea,
.chat-form button {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
}
@media (max-width: 700px) {
  .chat-form { max-width: 99vw; }
}


.note-margin { margin: 16px 0 0 0; }
.actions--mt16 { margin-top: 16px; }
.cell-break { max-width: 420px; word-break: break-word; }
.grid-auto120 { display: grid; grid-template-columns: repeat(auto-fit,minmax(120px,1fr)); gap: 12px; }
.grid-auto240 { display: grid; grid-template-columns: repeat(auto-fit,minmax(240px,1fr)); gap: 12px; }

.grid-gap { display: grid; gap: 8px; }
.w120 { max-width: 120px; }
.w140 { max-width: 140px; }
.w180 { max-width: 180px; }
.mt2 { margin-top: 2rem; }
.admin-chat-controls, .admin-chat-bulk {
  margin-bottom: 1.4rem;
}
.admin-form {
  margin-right: 16px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
}
.tbl-message {
  max-width: 480px;
  word-break: break-word;
}
@media (max-width: 700px) {
  .tbl-message { max-width: 240px; }
}

.grid-auto180 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}


.report-section {
  max-width: 420px;
  margin: 2.5rem auto;
  padding: 2rem 2.5rem 1.5rem 2.5rem;
  background: var(--surface, #2222 4%);
  border-radius: 1.5rem;
  box-shadow: 0 4px 20px #0002;
}

.report-img-meta {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.form-vertical {
  display: grid;
  gap: 14px;
  margin-top: 1rem;
}
.form-vertical label {
  font-weight: 500;
  margin-bottom: 2px;
}
.form-vertical input[type="text"], .form-vertical select {
  padding: 0.5em;
  border-radius: 6px;
  border: 1px solid #8883;
  background: var(--input-bg, #fff);
  width: 100%;
  box-sizing: border-box;
}
.form-vertical button {
  margin-top: 1rem;
  font-size: 1rem;
}

.rapportbajs {
  max-width: 360px;
  word-break: break-word;
}
