:root{
  --bg:#0b0f17;
  --card:#121a27;
  --muted:#7f8aa3;
  --text:#e8eefc;
  --accent:#7c5cff;
  --danger:#ff4d6d;
  --ok:#4dffb5;
  --border: rgba(255,255,255,0.08);
}

*{ box-sizing:border-box; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: radial-gradient(1000px 600px at 30% -10%, rgba(124,92,255,0.35), transparent 55%),
              radial-gradient(900px 500px at 90% 10%, rgba(77,255,181,0.18), transparent 55%),
              var(--bg);
  color:var(--text);
}

.container{ max-width: 980px; margin: 28px auto; padding: 0 16px; }
.topbar{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom: 16px; }
h1{ margin:0; font-size: 26px; letter-spacing: .3px; }

.card{
  background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent 30%), var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.25);
  margin-bottom: 16px;
}

.hidden{ display:none; }

.row{ display:flex; gap:10px; flex-wrap: wrap; }
.grid{ display:grid; grid-template-columns: 1fr 220px 180px 140px; gap: 10px; }
@media (max-width: 860px){
  .grid{ grid-template-columns: 1fr; }
}

input, button{
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 10px 12px;
  font-size: 14px;
  background: rgba(255,255,255,0.03);
  color: var(--text);
}
input::placeholder{ color: rgba(232,238,252,0.5); }

button{
  background: linear-gradient(180deg, rgba(124,92,255,0.9), rgba(124,92,255,0.7));
  border: 1px solid rgba(124,92,255,0.55);
  cursor: pointer;
  font-weight: 600;
}
button:hover{ filter: brightness(1.05); }
button.ghost{
  background: transparent;
  border: 1px solid var(--border);
}
button.danger{
  background: transparent;
  border: 1px solid rgba(255,77,109,0.35);
  color: var(--danger);
}

.divider{ height:1px; background: var(--border); margin: 14px 0; }

.hint{ color: var(--muted); margin: 10px 0 0; font-size: 13px; }
.msg{ color: var(--muted); margin: 10px 0 0; min-height: 18px; }

.mebox{
  display:flex; gap:10px; align-items:center;
  color: var(--muted);
}

.list{ display:flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.item{
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  display:flex;
  justify-content: space-between;
  gap: 12px;
  align-items:flex-start;
  background: rgba(255,255,255,0.02);
}
.item h3{ margin:0 0 4px; font-size: 16px; }
.meta{ color: var(--muted); font-size: 13px; }
.actions{ display:flex; gap:8px; flex-wrap: wrap; justify-content:flex-end; }
.badge{
  display:inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  margin-right: 6px;
}
.people{ margin-top: 8px; color: var(--muted); font-size: 13px; }
.people b{ color: var(--text); }
.tabs{
  display:flex;
  gap:10px;
  margin-bottom: 12px;
}
.tab{
  border-radius: 999px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  cursor:pointer;
}
.tab.active{
  background: linear-gradient(180deg, rgba(124,92,255,0.9), rgba(124,92,255,0.7));
  border-color: rgba(124,92,255,0.55);
}
.view.hidden{ display:none; }
/* ---- Mobile friendly tweaks ---- */
@media (max-width: 700px) {
  .container {
    margin: 16px auto;
    padding: 0 12px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  h1 {
    font-size: 22px;
  }

  /* Tabs: scrollbara om de inte får plats */
  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
  }
  .tabs::-webkit-scrollbar {
    height: 6px;
  }
  .tab {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  /* Form-rader: en kolumn */
  .row {
    flex-direction: column;
  }
  .row input,
  .row button {
    width: 100%;
  }

  /* Admin grid: alltid en kolumn på mobil */
  .grid {
    grid-template-columns: 1fr !important;
  }

  /* Film/medlem-kort: stacka innehåll + knappar */
  .item {
    flex-direction: column;
    align-items: stretch;
  }
  .actions {
    justify-content: flex-start;
  }
  .actions button {
    width: 100%;
  }

  /* Lite luftigare text */
  .meta,
  .people {
    font-size: 14px;
  }

  input, button {
    padding: 12px 12px;
    font-size: 16px; /* bättre på mobil (mindre zoom-problem) */
  }

  .card {
    padding: 14px;
    border-radius: 14px;
  }
}
/* ---- Modal (Edit shift) ---- */
.modal.hidden { display: none; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
}
.modal-card {
  position: relative;
  margin: 10vh auto 0;
  width: min(560px, calc(100% - 24px));
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(15, 18, 25, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 60px rgba(0,0,0,0.5);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.modal-body {
  padding: 14px;
  display: grid;
  gap: 12px;
}
.field span {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 6px;
}
.modal-actions {
  display: flex;
  gap: 10px;
}
.modal-actions button {
  flex: 1;
}
.iconbtn {
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}
@media (max-width: 700px) {
  .modal-card { margin-top: 12vh; }
  .modal-actions { flex-direction: column; }
}