* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  background: #0f1115;
  color: #e6e8eb;
}

.login-screen {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-box {
  background: #1a1d24;
  padding: 32px;
  border-radius: 12px;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.login-box h1 { font-size: 18px; margin-bottom: 8px; text-align: center; }
.login-box input {
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #333;
  background: #0f1115;
  color: #fff;
}
.login-box button {
  padding: 10px;
  border-radius: 6px;
  border: none;
  background: #4f8cff;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
}
.error { color: #ff6b6b; font-size: 13px; min-height: 16px; }

.shell { display: flex; flex-direction: column; height: 100vh; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: #1a1d24;
  border-bottom: 1px solid #2a2d34;
}
.brand { font-weight: 700; }
.tabs button {
  background: none;
  border: none;
  color: #a9adb4;
  padding: 8px 14px;
  cursor: pointer;
  border-radius: 6px;
  font-size: 14px;
}
.tabs button.active { background: #4f8cff; color: #fff; }
.user-box { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.user-box button {
  background: #2a2d34;
  border: none;
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
}

main { flex: 1; overflow: auto; padding: 16px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.tile {
  position: relative;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}
.tile video { width: 100%; display: block; aspect-ratio: 16/9; background: #000; }
.tile-label {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 6px 10px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  font-size: 13px;
}
.tile-remove {
  position: absolute; top: 6px; right: 6px;
  background: rgba(0,0,0,0.6); color: #fff; border: none;
  border-radius: 50%; width: 24px; height: 24px; cursor: pointer;
}
.empty { color: #888; padding: 20px; }

.toolbar { display: flex; gap: 10px; margin-bottom: 14px; align-items: center; }
.toolbar select, .toolbar button {
  padding: 8px 12px; border-radius: 6px; border: 1px solid #333;
  background: #1a1d24; color: #fff; cursor: pointer;
}

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal {
  background: #1a1d24; padding: 24px; border-radius: 10px; width: 420px; max-height: 80vh; overflow: auto;
}
.checklist { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.checklist label { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.modal-actions button, .modal button {
  padding: 8px 14px; border-radius: 6px; border: none; background: #4f8cff; color: #fff; cursor: pointer;
}

.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.card { background: #1a1d24; padding: 16px; border-radius: 10px; }
.card h3 { margin-top: 0; }
table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 12px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid #2a2d34; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; }
.inline-form input, .inline-form select {
  padding: 6px 8px; border-radius: 6px; border: 1px solid #333; background: #0f1115; color: #fff; font-size: 13px;
}
.inline-form button {
  padding: 6px 12px; border-radius: 6px; border: none; background: #4f8cff; color: #fff; cursor: pointer;
}
.hint { font-size: 12px; color: #888; }
.scan-row {
  padding: 8px 0; border-bottom: 1px solid #2a2d34; font-size: 13px;
}
.scan-row input { margin: 4px 6px 4px 0; padding: 4px 6px; border-radius: 4px; border: 1px solid #333; background: #0f1115; color: #fff; }
.scan-row button { padding: 4px 10px; border-radius: 4px; border: none; background: #4f8cff; color: #fff; cursor: pointer; }
